X

Select Your Country

Turkey (Türkçe)Turkey (Türkçe) Worldwide (English)Worldwide (English)
X

Select Your Country

Turkey (Türkçe)Turkey (Türkçe) Worldwide (English)Worldwide (English)
Kampanya duyurusu WELCOME Kupon Kodunu Kullanarak İlk Siparişlerinize Özel %10 İndirim İmkanından Faydalanabilirsiniz.

Mobile Proxy API Key Usage and IP Reset API Automation Guide

Using the API (Application Programming Interface) in Mobile Proxy services allows you to automate proxy management and eliminate manual operations. You can find detailed information about API Key, IP Reset operations, and automation integrations in this article.

What is an API Key and How to Use It?

An API Key is a unique authentication key that provides programmatic access to your Mobile Proxy service. With this key, you can perform proxy management operations through software, scripts, or automated systems.

Main advantages of using an API Key:

  • Changing IP addresses without manual intervention
  • Integration and automation with software
  • Time savings in bulk operations
  • Creating programmed IP rotation strategies
  • Ability to query service status

Accessing the Delivery File and Finding API Information

To access the API Key and related URLs, you first need to download your delivery file:

  1. Log in to your customer panel (livaproxy.com)
  2. Select the relevant Mobile Proxy service from the My Services section
  3. Click the "Download" button on the product management page
  4. Open the downloaded delivery file (usually in .txt or .pdf format)

The delivery file contains the following information:

  • Proxy server address (IP or hostname)
  • Port number
  • Username and password
  • API Key
  • IP Reset API URL
  • Other API endpoints specific to your usage

Using the IP Reset API

The IP Reset API allows you to programmatically change the IP address assigned to your Mobile Proxy service. This feature is critically important especially in automation projects.

API URL Format

In your delivery file, you will find a URL in the following format:

Example: https://api.livaproxy.com/reset?key=YOUR_API_KEY_HERE

You can change your IP address by sending an HTTP GET request to this URL.

Usage with Different Programming Languages

cURL (Command Line):

curl "https://api.livaproxy.com/reset?key=YOUR_API_KEY"

Python Example:

import requests

api_url = "https://api.livaproxy.com/reset?key=YOUR_API_KEY"
response = requests.get(api_url)
print(response.text)

JavaScript (Node.js) Example:

const fetch = require('node-fetch');

fetch('https://api.livaproxy.com/reset?key=YOUR_API_KEY')
  .then(response => response.text())
  .then(data => console.log(data));

PHP Example:

$api_url = "https://api.livaproxy.com/reset?key=YOUR_API_KEY";
$response = file_get_contents($api_url);
echo $response;

API Response Codes

Responses you will receive after an IP Reset API call:

Status CodeDescription
200 OKIP successfully changed
401 UnauthorizedInvalid API Key
429 Too Many RequestsToo many requests (rate limit exceeded)
503 Service UnavailableService temporarily unavailable

Important Considerations for IP Reset Operations

Important points to consider when performing IP reset via API:

  • Minimum Wait Time: IP reset operation takes 0-3 seconds. It is recommended to wait at least 5 seconds between consecutive requests
  • Per-Minute Limit: According to your service agreement, you can perform a maximum of 2 IP reset operations per minute
  • Connection Drops: Your active connections may be interrupted during IP changes, it's important that your application is designed to handle this
  • API Key Security: Never share your API Key in public code repositories (GitHub, etc.)

Automation Scenarios and Usage Examples

Time-Based Automatic IP Changing

You can use cron jobs or scheduled tasks to automatically change IP at specific intervals:

Linux Cron Example (Every 5 minutes):

*/5 * * * * curl "https://api.livaproxy.com/reset?key=YOUR_API_KEY"

IP Rotation Based on Request Count

Example of changing IP after a certain number of requests with Python:

import requests

api_key = "YOUR_API_KEY"
reset_url = f"https://api.livaproxy.com/reset?key={api_key}"
requests_count = 0
max_requests = 100

for i in range(1000):
    # Your operations here
    requests_count += 1
    
    if requests_count >= max_requests:
        requests.get(reset_url)
        requests_count = 0
        time.sleep(5)  # Wait for IP change

Automatic IP Change on Error Conditions

Automatically changing IP when you receive a ban from a website:

import requests

def make_request_with_auto_reset(url, proxy, reset_api):
    try:
        response = requests.get(url, proxies=proxy, timeout=10)
        if response.status_code == 403 or response.status_code == 429:
            # We're blocked, let's change IP
            requests.get(reset_api)
            time.sleep(5)
            # Retry
            return requests.get(url, proxies=proxy)
        return response
    except Exception as e:
        # Connection error, change IP
        requests.get(reset_api)
        time.sleep(5)
        return None

API Security and Best Practices

To ensure security in API usage:

  • Store the API Key in environment variables
  • Add .env files to .gitignore when uploading your code to version control systems
  • Follow rate limiting rules, don't send excessive requests
  • Track error conditions by logging API responses
  • Ensure HTTPS usage in production environment

Other API Functions

In your delivery file, you may find other API endpoints besides IP Reset:

  • Status Query API: Checks whether your service is active
  • Quota Query API: Allows you to find out your remaining internet quota
  • IP Information API: Returns your current IP address and location information

Please refer to the documentation in your delivery file for usage of these endpoints.

Common Problems and Solutions

Problem: API Key appears to be incorrect
Solution: When copying the API Key from the delivery file, make sure you haven't added spaces or invisible characters. Use the direct copy-paste method for the key.

Problem: IP reset operation is not working
Solution: The per-minute limit may have been exceeded. Wait at least 30 seconds and try again. Also make sure the API URL is correct.

Problem: I'm getting a 429 (Too Many Requests) error
Solution: Put longer wait times between requests. Follow the 2 resets per minute limit specified in your service agreement.

Technical Support

If you are experiencing problems with API usage or cannot access your delivery file, you can contact our 24/7 support team. When creating a support request, specifying the error messages you received regarding the API and the programming language/tool you are using will help resolve your issue faster.

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(0 times viewed / 0 people found it helpful)
Powered by WISECP
Top