GET
/
api
/
proxy
/
webshare
/
available
Get Available Webshare Proxies
curl --request GET \
  --url https://onlyautomator.com/api/proxy/webshare/available \
  --header 'Authorization: Bearer <token>'
{
  "count": 5,
  "next": "https://proxy.webshare.io/api/v2/proxy/list/?page=2",
  "previous": null,
  "results": [
    {
      "id": "pxid_abcdef123",
      "username": "webshare_user",
      "password": "webshare_pass",
      "proxy_address": "1.2.3.4",
      "port": 8080,
      "valid": true,
      "last_verification": "2023-09-16T12:00:00Z",
      "country_code": "DE",
      "city_name": "Berlin",
      "asn": {
        "asn": 123,
        "name": "<string>"
      }
    }
  ]
}

Get Available Webshare Proxies

This endpoint provides a direct view into the pool of proxies currently available via the configured Webshare API key. It allows filtering by country code and limiting the number of results.
This endpoint requires specific permissions and might expose sensitive information about the available proxy pool. It should typically only be accessible to administrators or internal services.
This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Due to the requirement for a live user session, this endpoint cannot be successfully tested directly using the ‘Send’ button in this documentation with a static token.To test:
  1. Call this endpoint from your web application after logging in.
  2. Use curl or a similar tool with a valid, current user JWT obtained from your browser’s session after logging in.
Retrieving JWT Token for Testing: To test endpoints requiring a user session with tools like curl, you need the JWT access token stored by Supabase Auth in your browser.
  1. Log in to your application normally in your browser.
  2. Open Developer Tools (usually F12).
  3. Go to the Application tab (it might be called Storage in Firefox).
  4. Under the Storage section, find Cookies and select your application’s domain (e.g., http://localhost:3000 or https://onlyautomator.com).
  5. Look for a cookie named similar to sb-access-token (the exact name might vary slightly based on Supabase configuration).
  6. Copy the entire value of this cookie. This is your Bearer token.
  7. Use this copied value in the Authorization: Bearer <your_copied_token> header for your curl or other API tool requests.
Note: This token has a limited lifetime and you’ll need to copy a fresh one after it expires.

Error Codes

Status CodeDescription
401Authentication is required or token lacks necessary permissions
500Internal error fetching or processing data from Webshare
503Webshare API itself is down or returned an error status

Code Examples

// Using fetch
const getAvailableProxies = async (apiToken, countryCode = null, limit = 100) => {
  const params = new URLSearchParams();
  if (countryCode) params.append('countryCode', countryCode);
  params.append('limit', limit);

  const response = await fetch(`https://onlyautomator.com/api/proxy/webshare/available?${params.toString()}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${apiToken}`
    }
  });
  
  return await response.json();
};

// Example usage: Get up to 50 available German proxies
getAvailableProxies('your_admin_api_token', 'DE', 50)
  .then(data => console.log('Available DE proxies:', data))
  .catch(error => console.error('Error fetching available proxies:', error));

Notes

  • This endpoint directly queries the Webshare /proxy/list/ API using the configured WEBSHARE_API_KEY.
  • The response includes proxies considered valid by Webshare.
  • It does not filter out proxies already assigned to accounts in the OnlyAutomator system; it shows the raw available pool.
  • Use this endpoint primarily for diagnostics or internal tooling, not typically for direct end-user consumption.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token for authentication (JWT)

Query Parameters

countryCode
string

Optional ISO country code to filter proxies.

Example:

"DE"

limit
integer
default:100

Maximum number of proxies to return.

Required range: x <= 1000

Response

List of available Webshare proxies.

count
integer
Example:

5

next
string<uri> | null
Example:

"https://proxy.webshare.io/api/v2/proxy/list/?page=2"

previous
string<uri> | null
Example:

null

results
object[]