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.
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:
To access the API Key and related URLs, you first need to download your delivery file:
The delivery file contains the following information:
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.
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.
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;
Responses you will receive after an IP Reset API call:
| Status Code | Description |
|---|---|
| 200 OK | IP successfully changed |
| 401 Unauthorized | Invalid API Key |
| 429 Too Many Requests | Too many requests (rate limit exceeded) |
| 503 Service Unavailable | Service temporarily unavailable |
Important points to consider when performing IP reset via API:
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"
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
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
To ensure security in API usage:
In your delivery file, you may find other API endpoints besides IP Reset:
Please refer to the documentation in your delivery file for usage of these endpoints.
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.
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.