Creating an API Key for Programmatic Access
You create an API key in the dashboard's API keys section to get a Bearer token for programmatic access. This key allows your scripts to manage proxy users, check your balance, and pull usage data without logging into the web interface.
- Generate API keys in the dashboard under the "API keys" tab.
- Use the key as a Bearer token in the Authorization header.
- API keys can be revoked at any time for security.
- The API provides endpoints for proxy users, balance, and usage.
Where to Create an API Key
You create an API key from the "API keys" tab within your RotatingProxy dashboard. After logging into your account, navigate to the main menu on the left side of the screen and click on "API keys" to access the key management interface. This section lists any existing keys and provides a button to generate a new one. The process is immediate and does not require email confirmation or additional steps.
Steps for Generating a New Key
Click the "Generate new key" button, confirm the action when prompted, and your new Bearer token will be displayed on screen. It is crucial to copy this key immediately and store it securely, as it will only be shown once for security reasons. The dashboard will not store the key in plain text again, so losing it requires generating a replacement. You can optionally add a note to the key for your own reference, such as "production scraper" or "test script".
How to Use the API Key for Authentication
Use the generated key as a Bearer token in the Authorization header of your HTTP requests to the API. The base URL for all API endpoints is https://rotatingproxy.cc/api/v1. For example, in a curl command, you would structure your request like this:
curl -H "Authorization: Bearer YOUR_API_KEY_HERE" https://rotatingproxy.cc/api/v1/balance
This authentication method is required for all endpoints described in the official API documentation. For practical integration code, refer to guides like Python requests proxy or axios proxy.
What You Can Do with the API
The API allows you to programmatically manage proxy users, check your prepaid balance, and retrieve detailed usage statistics. You can list existing proxy users, create new ones with specific network permissions and monthly GB caps, and pause or resume them. The balance endpoint returns your current US dollar balance, while the usage endpoints provide traffic breakdowns by day and network. This automation is invaluable for web scraping projects that need dynamic user management or for monitoring a scraper in production.
Security Best Practices for API Keys
Treat your API key like a password and never expose it in client-side code or public repositories. Store it in environment variables or a secure secrets management service. For instance, in a Python script, you would load it from an environment variable:
import os
API_KEY = os.environ.get('ROTATINGPROXY_API_KEY')
Regularly audit your active keys from the dashboard and revoke any that are no longer in use or that you suspect may be compromised. If a key is leaked, revoke it immediately and generate a new one; this action does not affect your existing proxy users or balance. Understanding proxy security basics complements good API key hygiene.
Common API Tasks and Examples
A typical automation script first checks the balance, then perhaps creates a dedicated proxy user for a task. Below is a conceptual example of creating a proxy user for residential IPs in Germany:
POST /api/v1/proxy-users
{
"login": "scraper_de",
"networks": ["res"],
"cap_gb": 100
}
The API will return the full proxy user details, including the automatically generated password. You can then construct the proxy endpoint string using another API endpoint or build it locally following the username options grammar. This workflow is common for price monitoring and rank tracking systems that run on schedules.
Managing and Revoking API Keys
You can view all active keys, see their last used timestamp if applicable, and delete them from the same "API keys" dashboard tab. Deleting a key instantly revokes its access, and any scripts using it will begin receiving 401 Unauthorized errors. It's good practice to use separate keys for different environments or applications to limit the blast radius if one is compromised. For teams, consider creating a key for a central management tool rather than sharing individual account credentials.
Integrating the API effectively can help manage costs, especially when combined with techniques for reducing proxy traffic costs. Always ensure your automated use complies with the acceptable use guidelines.
Questions
Can I create multiple API keys?
Yes, you can create multiple API keys from the dashboard. Each key functions independently, and you can label them for different applications or team members.
What happens if I lose my API key?
If you lose your API key, you cannot retrieve it again. You must generate a new key from the dashboard and update your scripts. The old key should be revoked if it's still active.
Does the API key have the same permissions as my account password?
The API key provides full programmatic access to manage proxy users, check balance, and view usage. It does not allow logging into the web dashboard, for which you still need your username and password.
Can I restrict what an API key can do?
No, API keys currently have full access to all API endpoints. For segmented access, you should create separate proxy users with specific network permissions and use different API keys for different scripts.
How do I check my balance using the API?
Send a GET request to the <code>/balance</code> endpoint with the Bearer token. The response will include your current balance in US dollars and the currency code.
Is there a rate limit on the API?
The API is designed for administrative use and has generous limits. Excessive polling is not necessary; for usage data, caching results for a few minutes is a recommended practice.
Start with one top-up, use any network
Create an account in a minute, add $40 or more, and the same balance pays for residential, mobile, datacenter and ISP traffic.