Skip to main content
GET
/
api
/
proxy
/
webshare
/
available-cities
Get Available Proxy Cities by Country
curl --request GET \
  --url https://onlyautomator.com/api/proxy/webshare/available-cities \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": [
    {
      "name": "Berlin"
    },
    {
      "name": "Frankfurt"
    },
    {
      "name": "Munich"
    }
    // ... more cities in Germany
  ]
}

Overview

This endpoint returns a list of cities within a specified country where OnlyAutomator can potentially assign Webshare proxies. It requires the countryCode as a query parameter. This is useful for refining the automatic proxy assignment preference beyond just the country level.
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.

Query Parameters

  • countryCode (string, required): The two-letter ISO 3166-1 alpha-2 country code (e.g., US, DE) for which to fetch available cities.

Responses

The response contains an array of available cities for the requested country.
{
  "success": true,
  "data": [
    {
      "name": "Berlin"
    },
    {
      "name": "Frankfurt"
    },
    {
      "name": "Munich"
    }
    // ... more cities in Germany
  ]
}

Response Data Structure

The data array contains objects, each representing a city:
  • name: (string) The name of the city where proxies are available.

Authorizations

Authorization
string
header
required

Standard user JWT token for authentication.

Headers

Authorization
string
required

Bearer token for authentication (JWT)

Query Parameters

countryCode
string
required

ISO 3166-1 alpha-2 country code to filter cities.

Example:

"DE"

Response

List of available cities for the specified country retrieved successfully.

success
boolean
Example:

true

data
object[]