NAV Navbar
python shell

Introduction

The Webshare API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

The Webshare API supports backwards compatibility. Any API changes always are backwards compatible.

We have language bindings in Shell and HTTP! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

Authenticated Request Example

import requests

requests.get("https://proxy.webshare.io/api/", headers={"Authorization": "Token <APIKEY>"})
# With shell, you can just pass the correct header with each request
curl "https://proxy.webshare.io/api/" \
  -H "Authorization: Token <APIKEY>"

Make sure to replace <APIKEY> with your API key.

Webshare uses API keys to allow access to the API. You can register a new Webshare API key at our API keys page.

Webshare expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Token <APIKEY>

User Profile

The user profile object

You can use the API to retrieve information about your Webshare user profile.

The user profile object

{  
  "email": "user@webshare.io",
  "full_name": "First Last Name",
  "date_joined": "2019-06-09T23:34:00.095501-07:00",
  "last_login": "2019-06-09T23:34:00.095501-07:00"
}

Reseller User Object

Attributes Description
email Email for the Webshare account
full_name Full name of the user. May be empty string. The name is retrieved from Google Auth.
date_joined Registration time of the Webshare account.
last_login Last login time of the Webshare account. The API requests do not modify the last_login field.

Get user profile

This endpoint retrieves the user profile.

import requests

response = requests.get("https://proxy.webshare.io/api/profile/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/profile/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "email": "user@webshare.io",
  "full_name": "First Last Name",
  "date_joined": "2019-06-09T23:34:00.095501-07:00",
  "last_login": "2019-06-09T23:34:00.095501-07:00"
}

HTTP Request

GET https://proxy.webshare.io/api/profile/

Subscription

The subscription object

You can use the API to retrieve information about your subscription.

The subscription object

{  
  "proxy_type": "cloud",
  "proxy_count": 105,
  "countries": {"US":5, "FR":100},
  "bandwidth_limit": 268435456000,

  "rotate_frequency": 3600,
  "rotate_percentage": 100,
  "last_rotate_at": "2019-05-09T23:34:00.095501-07:00",
  "next_rotate_at": "2019-05-10T23:34:00.095501-07:00",

  "unlimited_ip_authorizations": true,
  "unlimited_burst_threads": true,

  "start_date": "2019-05-09T23:34:00.095501-07:00",
  "end_date": "2019-06-09T23:34:00.095501-07:00",
  "renewals_paid": 0,

  "monthly_price": 29.99,
  "yearly_price": 299.99,
  "free_credits": 10.00
}

Subscription Object

Attributes Description
proxy_type Proxy types could be free,cloud, premiumcloud or dedicated.
proxy_count Number of proxies in the proxy subscription.
countries Number of proxies from each country code. ZZ means country will is randomly allocated.
bandwidth_limit The proxy bandwidth limit in bytes. 0 means unlimited.
rotate_frequency How often in seconds to rotate the proxy list. 0 value means do not rotate the proxy list.
rotate_percentage Percentage of proxies in the proxy list to rotate. Won't do anything if rotate_frequency is set to 0.
last_rotate_at Last time proxy list was rotated. Won't do anything if rotate_frequency is set to 0.
next_rotate_at Next time proxy list will be rotated. Won't do anything if rotate_frequency is set to 0.
unlimited_ip_authorizations If true subscription supports unlimited IP Authorizations. If false, only 1 IP Authorization is supported.
unlimited_burst_threads If true subscription supports up to 2,000 concurrent proxy requests. If false, 500 concurrent proxy requests are supported.
start_date The start date of the subscription.
end_date The end date of the subscription. The bandwidth will reset on this date.
renewals_paid Number of subscription renewals paid. Each renewal corresponds to a month. If renewals_paid is 0, you will be charged monthly_price to renew your subscription.
monthly_price Monthly price of the subscription in USD.
yearly_price Yearly price of the subscription in USD.
free_credits Free credits available in your account in USD.

Get subscription

This endpoint retrieves the subscription object

import requests

response = requests.get("https://proxy.webshare.io/api/subscription/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/subscription/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "proxy_type": "cloud",
  "proxy_count": 105,
  "countries": {"US":5, "FR":100},
  "bandwidth_limit": 268435456000,

  "rotate_frequency": 3600,
  "rotate_percentage": 100,
  "last_rotate_at": "2019-05-09T23:34:00.095501-07:00",
  "next_rotate_at": "2019-05-10T23:34:00.095501-07:00",

  "unlimited_ip_authorizations": true,
  "unlimited_burst_threads": true,

  "start_date": "2019-05-09T23:34:00.095501-07:00",
  "end_date": "2019-06-09T23:34:00.095501-07:00",
  "renewals_paid": 0,

  "monthly_price": 29.99,
  "yearly_price": 299.99,
  "free_credits": 10.00
}

HTTP Request

GET https://proxy.webshare.io/api/subscription/

Proxy Configuration

The proxy config object

You can use the API to retrieve information about your proxy configuration.

The proxy config object

{
  "countries": {"US":5, "FR":100},
  "username": "hasdyas",
  "password": "jasdi2148",
  "authorized_ips": ["10.2.5.10", "10.2.6.10"]
}

Reseller User Object

Attributes Description
countries Dictionary of proxy counts by country code.
username Username of the proxy.
password Password of the proxy.
authorized_ips List of IP addresses. IPs authorized to make requests to Webshare Proxy. authorized_ips is used only if not using username/password.

Get proxy config

This endpoint retrieves the proxy config.

import requests

response = requests.get("https://proxy.webshare.io/api/proxy/config/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/proxy/config/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "countries": {"US":5, "FR":100},
  "username": "hasdyas",
  "password": "jasdi2148",
  "authorized_ips": ["10.2.5.10", "10.2.6.10"]
}

HTTP Request

GET https://proxy.webshare.io/api/proxy/config/

Update proxy config

This endpoint updates the proxy config.

import requests

response = requests.post(
    "https://proxy.webshare.io/api/proxy/config/",
    json={"authorized_ips":["10.3.5.10"]},  
    headers={"Authorization": "Token <APIKEY>"}
)
response.json()
curl "https://proxy.webshare.io/api/proxy/config/" \
  -X POST \
  -d "{\"authorized_ips\": [\"10.3.5.10\"]}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "countries": {"US":5, "FR":100},
  "username": "hasdyas",
  "password": "newpassword",
  "authorized_ips": ["10.3.5.10"]
}

HTTP Request

POST https://proxy.webshare.io/api/proxy/config/

Request Body

Parameter Description
authorized_ips The new list of authorized IPs.

Reset proxy password

This endpoint resets the proxy password.

import requests

response = requests.post("https://proxy.webshare.io/api/proxy/config/reset_password/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/proxy/config/reset_password/" \
  -X POST \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "countries": {"US":5, "FR":100},
  "username": "hasdyas",
  "password": "newpassword",
  "authorized_ips": ["10.2.5.10", "10.2.6.10"]
}

HTTP Request

POST https://proxy.webshare.io/api/proxy/config/reset_password/

Proxy List

The proxy list object

You can use the API to retrieve information about your proxy list.

The proxy list object

{  
  "username": "hasdyas-5",
  "password": "jasdi2148",
  "proxy_address": "193.8.94.149",
  "ports": {"http":20004, "socks5":10004},
  "country_code": "US",
  "country_code_confidence": 0.95
}

Note: This API is paginated and returns multiple proxy list objects.

Proxy List Object

Attributes Description
username Full proxy username.
password Proxy password.
proxy_address Assigned IP address of the proxy. Do not connect to this address unless you are using Direct Connection option.
ports Dictionary of ports by proxy protocol. Used for IP Authorization requests only.
country_code The country code of the proxy.
country_code_confidence The country code confidence of the proxy. Must be a number between 0 to 1.

List proxies

This endpoint lists the proxies.

import requests

response = requests.get("https://proxy.webshare.io/api/proxy/list/?page=1&countries=US-FR", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/proxy/list/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{
    "count": 1000,
    "next": "https://proxy.webshare.io/api/proxy/list/?page=2",
    "previous": null,
    "results": [
        {  
          "username": "hasdyas-5",
          "password": "jasdi2148",
          "proxy_address": "193.8.94.149",
          "ports": {"http":20004, "socks5":10004}
        },
        ...
    ]
}

HTTP Request

GET https://proxy.webshare.io/api/proxy/list/

URL Parameters

Parameter Description
page The current page for the proxies. Optional. Defaults to 1.
countries Filter proxies using - separated country codes. Optional. Defaults to all countries. E.g. US, US-FR, US-FR-JP-DE

Proxy Stats

The proxy stats object

You can use the API to retrieve information about your proxy statistics.

The proxy stats object

{  
  "bandwidth_used": 5368709120,
  "bandwidth_remaining": 48318382080,
  "bandwidth_limit": 53687091200,
  "bandwidth_projected": 59055800320,

  "last_request_at": "2019-06-09T23:34:00.095501-07:00",

  "requests_total": 5000,
  "requests_successful": 4999,
  "requests_failed": 1,
  "request_countries":{"US":4000, "FR":500, "GB":500},
  "requests_error_reasons":{"no_proxies_allocated": 1}
}

Proxy Stats Object

Attributes Description
bandwidth_used Proxy bandwidth used so far in bytes.
bandwidth_remaining Proxy bandwidth remaining in bytes. null if bandwidth limit is unlimited.
bandwidth_limit Proxy bandwidth limit. 0 if bandwidth limit is unlimited.
bandwidth_projected Projected bandwidth usage in bytes.
last_request_at The time of the last request. If no requests are sent, the value is null.
requests_total Number of proxy requests sent through Webshare Proxy.
requests_successful Number of successful proxy requests sent through Webshare Proxy.
requests_failed Number of failed proxy requests sent through Webshare Proxy.
request_countries Dictionary of proxy requests sent through Webshare Proxy by country code.
requests_error_reasons Dictionary of number of proxy request failure by error reason.

Get user profile

This endpoint retrieves the proxy stats.

import requests

response = requests.get("https://proxy.webshare.io/api/proxy/stats/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/proxy/stats/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
  "bandwidth_used": 5368709120,
  "bandwidth_remaining": 48318382080,
  "bandwidth_limit": 53687091200,
  "bandwidth_projected": 59055800320,

  "requests_total": 5000,
  "requests_countries":{"US":4000, "FR":500, "GB":500},
  "requests_successful": 4999,
  "requests_failed": 1,
  "request_failure_status_code":{"502": 1}
}

HTTP Request

GET https://proxy.webshare.io/api/proxy/stats/

Reseller User

This API is only available for reseller users. I you wish to gain access to this API, please send us a message at contact@webshare.io

The reseller user object

To create a reseller user, you can use the API. You can retrieve, update and see the status of each individual reseller user.

The reseller user object

{  
   "id":7,
   "label":"Test User",
   "proxy_username":"eezocwls",
   "proxy_password":"r732w3h035mx",
   "proxy_limit":10.0,
   "proxy_usage":0,
   "max_thread_count": 500,
   "last_use":null,
   "default_country_codes":null,
   "ip_address_authentication":[  
      "85.24.61.22"
   ],
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_start_date":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_end_date":"2019-07-09T23:34:00.095517-07:00",
   "verification_status": "not_required"

}

Reseller User Object

Attributes Description
id Unique identifier of the reseller user. The ID never changes and no other reseller user will receive the same ID.
label You can set label to identify your reseller users.
proxy_username The username to connect to the Webshare Proxy.
proxy_password The password to connect to the Webshare Proxy.
proxy_limit The reseller user proxy limit in GBs. You can set to 0 in order to get unlimited bandwidth.
max_thread_count The maximum number of concurrency this reseller user can have.
proxy_usage The reseller user proxy usage in bytes.
last_use ISO 8601 timestamp of the last time proxy was used. Example: 2019-06-10T01:49:10Z
default_country_codes List of country codes where proxy should be from. Use all countries if field is set to null. Example: ["US", "FR"]
ip_address_authentication List of IP addresses end-user can connect to proxy from. Example ["85.24.61.22"]
created_at Read-only field to indicate when this reseller user was created.
updated_at Read-only field to indicate when this reseller user was last updated.
bandwidth_use_start_date The time we start calculating the reseller user bandwidth use. You can edit this field.
bandwidth_use_end_date The time the reseller user bandwidth use will reset. Read-only field.
verification_status The current account verification status of this reseller user. See table below for detailed information.

Possible verification_status Fields

verification_status Description
not_required No account verification is required for this reseller user.
in_progress Account verification is active for this user. Please check your email for further instructions.
verified This reseller user is verified to use Webshare Proxy. Its unlikely that this reseller user will be asked to verify again.
suspended This reseller user was found to be not compatible with the Terms and Conditions of Webshare Proxy.

Create a reseller user

Create a new reseller user by setting label and bandwidth limit.

import requests

response = requests.post(
    "https://proxy.webshare.io/api/reseller/",
    json={"label":"newcustomer", "proxy_limit": 10, "max_thread_count":500}, 
    headers={"Authorization": "Token <APIKEY>"}
)
response.json()
curl "https://proxy.webshare.io/api/reseller/" \
  -X POST \
  -d "{\"label\": \"newlabel\", \"proxy_limit\": 10, \"max_thread_count\":500}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "id":7,
   "label":"newcustomer",
   "proxy_username":"eezocwls",
   "proxy_password":"r732w3h035mx",
   "proxy_limit":10.0,
   "proxy_usage":0,
   "max_thread_count": 500,
   "last_use":null,
   "default_country_codes":null,
   "ip_address_authentication":[  

   ],
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_start_date":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_end_date":"2019-07-09T23:34:00.095517-07:00"
}

HTTP Request

POST https://proxy.webshare.io/api/reseller/

Get a reseller user

This endpoint retrieves a specific reseller user.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/<ID>/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/<ID>/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "id":7,
   "label":"Test User",
   "proxy_username":"eezocwls",
   "proxy_password":"r732w3h035mx",
   "proxy_limit":10.0,
   "proxy_usage":0,
   "last_use":null,
   "default_country_codes":null,
   "ip_address_authentication":[  

   ],
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_start_date":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_end_date":"2019-07-09T23:34:00.095517-07:00",
   "verification_status": "not_required"
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/<ID>/

URL Parameters

Parameter Description
ID The ID of the reseller user to retrieve

Get a reseller user

This endpoint retrieves proxy stats for a reseller user. Proxy stats are calculated from the beginning of the user's bandwidth_use_start_date.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/<ID>/stats/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/<ID>/stats/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
    "bandwidth_used": 2097152,
    "bandwidth_remaining": 53684994048,
    "bandwidth_limit": 53687091200,
    "bandwidth_projected": 500000,
    "last_request_at": "2019-06-09T23:34:00.095517-07:00",
    "requests_total": 2,
    "requests_successful": 1,
    "requests_failed": 1,
    "request_countries": {"US": 2},
    "requests_error_reasons": {"io_timeout":  1}
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/<ID>/stats/

URL Parameters

Parameter Description
ID The ID of the reseller user to retrieve

Reseller User Stats Object

Attributes Description
bandwidth_used Proxy bandwidth used so far in bytes.
bandwidth_remaining Proxy bandwidth remaining in bytes. null if bandwidth limit is unlimited.
bandwidth_limit Proxy bandwidth limit. 0 if bandwidth limit is unlimited.
bandwidth_projected Projected bandwidth usage in bytes.
last_request_at The time of the last request. If no requests are sent, the value is null.
requests_total Number of proxy requests sent through Webshare Proxy.
requests_successful Number of successful proxy requests sent through Webshare Proxy.
requests_failed Number of failed proxy requests sent through Webshare Proxy.
request_countries Dictionary of proxy requests sent through Webshare Proxy by country code.
requests_error_reasons Dictionary of number of proxy request failure by error reason.

List reseller users

This endpoint retrieves all reseller users in the system.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "count":1,
   "next":null,
   "previous":null,
   "results":[  
      {  
         "id":7,
         "label":"Test User",
         "proxy_username":"eezocwls",
         "proxy_password":"r732w3h035mx",
         "proxy_limit":10.0,
         "proxy_usage":0,
         "last_use":null,
         "default_country_codes":null,
         "ip_address_authentication":[  

         ],
         "created_at":"2019-06-09T23:34:00.095501-07:00",
         "updated_at":"2019-06-09T23:34:00.095517-07:00",
         "bandwidth_use_start_date":"2019-06-09T23:34:00.095517-07:00",
         "bandwidth_use_end_date":"2019-07-09T23:34:00.095517-07:00",
         "verification_status": "not_required"
      }
   ]
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/

URL Parameters

Parameter Default Description
page 1 Change the current page

Update a reseller user

Update an existing reseller user. You can partially update only the fields you wish to update.

import requests

response = requests.patch(
    "https://proxy.webshare.io/api/reseller/<ID>/",
    json={"label":"newlabel"}, 
    headers={"Authorization": "Token <APIKEY>"}
)
response.json()
curl "https://proxy.webshare.io/api/reseller/<ID>/" \
  -X PATCH \
  -d "{\"label\": \"newlabel\"}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "id":7,
   "label":"newlabel",
   "proxy_username":"eezocwls",
   "proxy_password":"r732w3h035mx",
   "proxy_limit":10.0,
   "proxy_usage":0,
   "last_use":null,
   "default_country_codes":null,
   "ip_address_authentication":[  

   ],
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_start_date":"2019-06-09T23:34:00.095517-07:00",
   "bandwidth_use_end_date":"2019-07-09T23:34:00.095517-07:00",
   "verification_status": "not_required"
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/<ID>/

URL Parameters

Parameter Description
ID The ID of the reseller user to retrieve

Delete a reseller user

This endpoint deletes a reseller user.

import requests

response = requests.delete("https://proxy.webshare.io/api/reseller/<ID>/", headers={"Authorization": "Token <APIKEY>"})

curl "https://proxy.webshare.io/api/reseller/<ID>/" \
  -X DELETE \
  -H "Authorization: Token <APIKEY>"

The above command returns empty response with 204 HTTP status code

HTTP Request

DELETE https://proxy.webshare.io/api/reseller/<ID>/

URL Parameters

Parameter Description
ID The ID of the reseller user to delete.

Reseller IP Auth Removal

This API is only available for reseller users. I you wish to gain access to this API, please send us a message at contact@webshare.io

The reseller IP auth removal (RIAR) object

This API will let you remove IP address authentication from other accounts in Webshare Proxy system. Use this API when you receive "IP address already in-use" error while you are trying to assign an ip_address_authentication to a reseller user.

To create a reseller RIAR, you can use the API. You can retrieve, update and see the status of each individual removal requests.

The reseller IP auth removal (RIAR) object

{  
   "id":7,
   "ip_address": "10.1.0.1",
   "reseller_user": 1523,
   "state": "processing",
   "verdict": None,
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
}

Reseller IP Auth Removal (RIAR) Object

Attributes Description
id Unique identifier of the RIAR. The ID never changes and no other RIAR will receive the same ID.
ip_address IP address you wish to add to your reseller user
reseller_user If RIAR is approved, this reseller_user will be assigned the ip_address
state The current state of the RIAR. See table below for detailed information.
verdict When the state is set to "completed", a verdict will be published in this field.
created_at Read-only field to indicate when the RIAR was created.
updated_at Read-only field to indicate when the RIAR was last updated.

Possible State Fields

State Description
pending Every RIAR starts in pending state. Usually should last in this state 0-2 seconds.
processing The RIAR is now being processed by our automated system. Should last in this state 0-2 seconds.
requires_approval The RIAR requires manual approval by the Webshare team. Should last in this state 0-48 hours.
completed The RIAR processing is completed. Check the verdict field for results.

Possible Verdict Fields

Verdict Description
removed The IP address is now re-assigned to your Reseller User successfully.
cancelled You have cancelled the RIAR request.
used_by_active_customer This RIAR request cannot be completed as the IP address is actively used by another Webshare user. Contact us at contact@webshare.io to sort things out.

Create a reseller IP auth removal request

Create a new reseller IP auth removal request by setting the reseller user you wish to assign the new IP authorization to.

import requests

response = requests.post(
    "https://proxy.webshare.io/api/reseller/ipauthremoval/",
    json={"ip_address": "10.1.0.1", "reseller_user": 1537}, 
    headers={"Authorization": "Token <APIKEY>"}
)
response.json()
curl "https://proxy.webshare.io/api/reseller/ipauthremoval/" \
  -X POST \
  -d "{\"ip_address\": \"10.1.0.1\", \"reseller_user\": 1537}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "id":7,
   "ip_address": "10.1.0.1"
   "reseller_user": 1523,
   "state": "processing",
   "verdict": null,
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
}

HTTP Request

POST https://proxy.webshare.io/api/reseller/ipauthremoval/

Get a reseller IP auth removal request

This endpoint retrieves a specific reseller IP auth removal request.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "id":7,
   "ip_address": "10.1.0.1",
   "reseller_user": 1523,
   "state": "processing",
   "verdict": null,
   "created_at":"2019-06-09T23:34:00.095501-07:00",
   "updated_at":"2019-06-09T23:34:00.095517-07:00",
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/

URL Parameters

Parameter Description
ID The ID of the reseller user to retrieve.

List reseller IP auth removal requests

This endpoint retrieves all reseller IP auth removal requests in the system.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/ipauthremoval/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/ipauthremoval/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "count":1,
   "next":null,
   "previous":null,
   "results":[{  
      "id":7,
      "ip_address": "10.1.0.1",
      "reseller_user": 1523,
      "state": "processing",
      "verdict": null,
      "created_at":"2019-06-09T23:34:00.095501-07:00",
      "updated_at":"2019-06-09T23:34:00.095517-07:00",  
   }]
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/ipauthremoval/

URL Parameters

Parameter Default Description
page 1 Change the current page

Cancel a reseller IP auth removal request

You can cancel a reseller IP auth removal request if the state is not completed or processing

import requests

response = requests.post(
    "https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/cancel/", 
    headers={"Authorization": "Token <APIKEY>"}
)

curl "https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/cancel/" \
  -X POST \
  -H "Authorization: Token <APIKEY>"

The above command returns the current reseller IP auth removal object with 200 HTTP status code

HTTP Request

POST https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/cancel/

URL Parameters

Parameter Description
ID The ID of the reseller IP auth removal request.

Reseller Account Verification

From time to time, you may receive account verification requests from Webshare team. These account verification requests may require additional information on how your customers use the proxies. Account verifications are there to protect your account and the Webshare Proxy network from mis-use.

When you receive an account verification request, its utmost importance that you collect all the necessary information and submit a decision in a timely manner.

This API is only available for reseller users. I you wish to gain access to this API, please send us a message at contact@webshare.io

Reseller Account Verification

This API will let you view and decide on all account verifications. Already completed account verifications can be found in the API too.

Account Verification Object

{
    "id": 5,
    "reseller_user": 5123,
    "reason": "This account requires additional verification due to suspicious behavior.",
    "type": "acceptable_use",
    "state": "inflow",
    "created_at": "2019-06-09T23:34:00.095501-07:00",
    "updated_at": "2019-06-09T23:34:00.095501-07:00",
    "started_at": "2019-06-09T23:34:00.095501-07:00",
    "evidence": {
        "explanation": "The explanation submitted by you.",
        "updated_at": "2019-06-09T23:34:00.095501-07:00",
        "started_at": "2019-06-09T23:34:00.095501-07:00"
    }
}

Account Verification Object

Attributes Description
id Unique identifier of the Account Verification. The ID never changes and no other Account Verification will receive the same ID.
reseller_user Unique identifier of the reseller_user.
type Type of the account verification. See table below for detailed information.
state The current state of the account verification. See table below for detailed information.
created_at Time field to indicate when the Account Verification was created.
updated_at Time field to indicate when the Account Verification was last updated.
started_at Time field to indicate when the Account Verification timer started at. All of the verification action timers are based on started_at. This field is usually same as the created_at field.
evidence If a decision is submitted by you, the evidence field will be populated. Otherwise, it is null.

Possible Type Fields

State Description
acceptable_use We have reason to believe that this reseller user may be in breach of acceptable use policy.
abuse_report This user is in breach of acceptable use policy. Their account is terminated immediately.

Possible state Fields

Verdict Description
inflow This verification request is pending your input.
successful_verification The verification of this account is successful.
failed_verification The verification of this account failed and the account owner is suspended from the Webshare Proxy network.
error You should not ever see this state. If you do, please contact us at contact@webshare.io

Get a reseller account verification object

This endpoint retrieves a specific reseller account verification.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/verification/<ID>/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/verification/<ID>/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
    "id": 5,
    "reseller_user": 5123,
    "reason": "This account requires additional verification due to suspicious behavior.",
    "type": "acceptable_use",
    "state": "inflow",
    "created_at": "2019-06-09T23:34:00.095501-07:00",
    "updated_at": "2019-06-09T23:34:00.095501-07:00",
    "started_at": "2019-06-09T23:34:00.095501-07:00",
    "evidence": {
        "explanation": "The explanation submitted by you.",
        "updated_at": "2019-06-09T23:34:00.095501-07:00",
        "started_at": "2019-06-09T23:34:00.095501-07:00"
    }
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/verification/<ID>/

URL Parameters

Parameter Description
ID The ID of the account verifications to retrieve.

Decide on the results of an account verification

You can decide on the reslt of an account verification if the state is inflow

import requests

response = requests.post(
    "https://proxy.webshare.io/api/reseller/verification/<ID>/decide/",
    json={
        "explanation": "We have reviewed the use case of this account with the account owner. They are using the proxies for ... use-case. We do not see a reason to suspend this account.",
        "verdict": "verify_user"
    },    
    headers={"Authorization": "Token <APIKEY>"}
)

curl "https://proxy.webshare.io/api/reseller/ipauthremoval/<ID>/cancel/" \
  -X POST \
  -d "{\"verdict\": \"verify_user\", \"explanation\": \"We have reviewed the use case of this account with the account owner. They are using the proxies for ... use-case. We do not see a reason to suspend this account.\"}" \
  -H "Authorization: Token <APIKEY>"

The above command returns the current account verification object with 200 HTTP status code

HTTP Request

POST https://proxy.webshare.io/api/reseller/verification/<ID>/decide/

URL Parameters

Parameter Description
ID The ID of the reseller IP auth removal request.

Request Body

Field Description
explanation The explanation of your decision. Please include as much as detail as possible.
verdict The result of your decision. Can be verify_user or suspend_user.

List Reseller Account Verification

This endpoint retrieves all reseller account verifications in the system.

import requests

response = requests.get("https://proxy.webshare.io/api/reseller/verification/", headers={"Authorization": "Token <APIKEY>"})
response.json()
curl "https://proxy.webshare.io/api/reseller/verification/" \
  -H "Authorization: Token <APIKEY>"

The above command returns JSON structured like this:

{  
   "count":1,
   "next":null,
   "previous":null,
   "results":[{  
        "id": 5,
        "reseller_user": 5123,
        "reason": "This account requires additional verification due to suspicious behavior.",
        "type": "acceptable_use",
        "state": "inflow",
        "created_at": "2019-06-09T23:34:00.095501-07:00",
        "updated_at": "2019-06-09T23:34:00.095501-07:00",
        "started_at": "2019-06-09T23:34:00.095501-07:00",
        "evidence": {
            "explanation": "The explanation submitted by you.",
            "updated_at": "2019-06-09T23:34:00.095501-07:00",
            "started_at": "2019-06-09T23:34:00.095501-07:00"
        }
   }]
}

HTTP Request

GET https://proxy.webshare.io/api/reseller/verification/

URL Parameters

Parameter Default Description
page 1 Change the current page

Errors

The Webshare API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid. Check the response body to see why.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- You are forbidden to access the API. Upgrade your plan to gain access.
404 Not Found -- The specified resource could not be found. Maybe its deleted?
405 Method Not Allowed -- You tried to access a Webshare API with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
500 Internal Server Error -- We had a problem with our server. We have been notified and working on fixing the issue. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.