# Table of Contents - [Proxy Server API – Webshare API Docs](#proxy-server-api-webshare-api-docs) - [MCP Server – Webshare API Docs](#mcp-server-webshare-api-docs) - [Local Account – Webshare API Docs](#local-account-webshare-api-docs) - [Reset Password – Webshare API Docs](#reset-password-webshare-api-docs) - [Social Account – Webshare API Docs](#social-account-webshare-api-docs) - [Change Email – Webshare API Docs](#change-email-webshare-api-docs) - [Activate Account – Webshare API Docs](#activate-account-webshare-api-docs) - [CLI & SDKs – Webshare API Docs](#cli-sdks-webshare-api-docs) - [Registration and Login – Webshare API Docs](#registration-and-login-webshare-api-docs) - [Delete Account – Webshare API Docs](#delete-account-webshare-api-docs) - [Delete Social Account – Webshare API Docs](#delete-social-account-webshare-api-docs) - [Logout – Webshare API Docs](#logout-webshare-api-docs) - [Two factor authentication (2FA) – Webshare API Docs](#two-factor-authentication-2fa-webshare-api-docs) - [Enter 2fa Code – Webshare API Docs](#enter-2fa-code-webshare-api-docs) - [Get 2fa Method – Webshare API Docs](#get-2fa-method-webshare-api-docs) - [Change 2fa Method – Webshare API Docs](#change-2fa-method-webshare-api-docs) - [Change Password – Webshare API Docs](#change-password-webshare-api-docs) - [Activate 2fa Method – Webshare API Docs](#activate-2fa-method-webshare-api-docs) - [Resend 2fa Email – Webshare API Docs](#resend-2fa-email-webshare-api-docs) - [User Profile – Webshare API Docs](#user-profile-webshare-api-docs) - [Retrieve – Webshare API Docs](#retrieve-webshare-api-docs) - [Update – Webshare API Docs](#update-webshare-api-docs) - [Retrivepreferences – Webshare API Docs](#retrivepreferences-webshare-api-docs) - [Updatepreferences – Webshare API Docs](#updatepreferences-webshare-api-docs) - [Notifications – Webshare API Docs](#notifications-webshare-api-docs) - [List Notifications – Webshare API Docs](#list-notifications-webshare-api-docs) - [Get notification – Webshare API Docs](#get-notification-webshare-api-docs) - [Dismiss notification – Webshare API Docs](#dismiss-notification-webshare-api-docs) - [Restore notification – Webshare API Docs](#restore-notification-webshare-api-docs) - [Proxy List API – Webshare API Docs](#proxy-list-api-webshare-api-docs) - [List proxies – Webshare API Docs](#list-proxies-webshare-api-docs) - [Download proxy list – Webshare API Docs](#download-proxy-list-webshare-api-docs) - [Refresh proxy list – Webshare API Docs](#refresh-proxy-list-webshare-api-docs) - [Proxy Connection – Webshare API Docs](#proxy-connection-webshare-api-docs) - [Proxy Replacement – Webshare API Docs](#proxy-replacement-webshare-api-docs) - [List proxy replacement – Webshare API Docs](#list-proxy-replacement-webshare-api-docs) - [The replaced proxy – Webshare API Docs](#the-replaced-proxy-webshare-api-docs) - [Download replaced proxy list – Webshare API Docs](#download-replaced-proxy-list-webshare-api-docs) - [Get proxy replacement – Webshare API Docs](#get-proxy-replacement-webshare-api-docs) - [IP Authorization – Webshare API Docs](#ip-authorization-webshare-api-docs) - [List Replaced Proxy – Webshare API Docs](#list-replaced-proxy-webshare-api-docs) - [The proxy replacement object – Webshare API Docs](#the-proxy-replacement-object-webshare-api-docs) - [Get proxy stats – Webshare API Docs](#get-proxy-stats-webshare-api-docs) - [Proxy Configuration – Webshare API Docs](#proxy-configuration-webshare-api-docs) - [Create IP authorization – Webshare API Docs](#create-ip-authorization-webshare-api-docs) - [Create proxy replacement – Webshare API Docs](#create-proxy-replacement-webshare-api-docs) - [List IP Authorization – Webshare API Docs](#list-ip-authorization-webshare-api-docs) - [Suspended – Webshare API Docs](#suspended-webshare-api-docs) - [Get proxy status – Webshare API Docs](#get-proxy-status-webshare-api-docs) - [Get proxy config – Webshare API Docs](#get-proxy-config-webshare-api-docs) - [Get IP authorization – Webshare API Docs](#get-ip-authorization-webshare-api-docs) - [Submit security code – Webshare API Docs](#submit-security-code-webshare-api-docs) - [Referral Info – Webshare API Docs](#referral-info-webshare-api-docs) - [Retrieve verification – Webshare API Docs](#retrieve-verification-webshare-api-docs) - [What's my IP – Webshare API Docs](#what-s-my-ip-webshare-api-docs) - [Abuse reports – Webshare API Docs](#abuse-reports-webshare-api-docs) - [Proxy Statistics – Webshare API Docs](#proxy-statistics-webshare-api-docs) - [Update proxy config – Webshare API Docs](#update-proxy-config-webshare-api-docs) - [Delete IP Authorization – Webshare API Docs](#delete-ip-authorization-webshare-api-docs) - [Proxy Activity – Webshare API Docs](#proxy-activity-webshare-api-docs) - [Renew the subscription – Webshare API Docs](#renew-the-subscription-webshare-api-docs) - [Aggregate stats – Webshare API Docs](#aggregate-stats-webshare-api-docs) - [Auto-renewal – Webshare API Docs](#auto-renewal-webshare-api-docs) - [Download Invoice – Webshare API Docs](#download-invoice-webshare-api-docs) - [Download proxy activities – Webshare API Docs](#download-proxy-activities-webshare-api-docs) - [Categories – Webshare API Docs](#categories-webshare-api-docs) - [Update payment method – Webshare API Docs](#update-payment-method-webshare-api-docs) - [Submit Evidence – Webshare API Docs](#submit-evidence-webshare-api-docs) - [Account Verification – Webshare API Docs](#account-verification-webshare-api-docs) - [Thresholds – Webshare API Docs](#thresholds-webshare-api-docs) - [List appeals – Webshare API Docs](#list-appeals-webshare-api-docs) - [List verifications – Webshare API Docs](#list-verifications-webshare-api-docs) - [List questions – Webshare API Docs](#list-questions-webshare-api-docs) - [Limits – Webshare API Docs](#limits-webshare-api-docs) - [Submit answer – Webshare API Docs](#submit-answer-webshare-api-docs) - [Complete verification – Webshare API Docs](#complete-verification-webshare-api-docs) - [Start – Webshare API Docs](#start-webshare-api-docs) - [View Suspension – Webshare API Docs](#view-suspension-webshare-api-docs) - [ID Verification – Webshare API Docs](#id-verification-webshare-api-docs) - [Update API key – Webshare API Docs](#update-api-key-webshare-api-docs) - [Get ID Verification – Webshare API Docs](#get-id-verification-webshare-api-docs) - [API Keys – Webshare API Docs](#api-keys-webshare-api-docs) - [Allocate unallocated countries – Webshare API Docs](#allocate-unallocated-countries-webshare-api-docs) - [List stats – Webshare API Docs](#list-stats-webshare-api-docs) - [Delete API key – Webshare API Docs](#delete-api-key-webshare-api-docs) - [Submit appeal – Webshare API Docs](#submit-appeal-webshare-api-docs) - [Available assets – Webshare API Docs](#available-assets-webshare-api-docs) - [Sub-Users – Webshare API Docs](#sub-users-webshare-api-docs) - [Masquerade as a user – Webshare API Docs](#masquerade-as-a-user-webshare-api-docs) - [Delete a user – Webshare API Docs](#delete-a-user-webshare-api-docs) - [Get API key – Webshare API Docs](#get-api-key-webshare-api-docs) - [List API keys – Webshare API Docs](#list-api-keys-webshare-api-docs) - [Create API key – Webshare API Docs](#create-api-key-webshare-api-docs) - [Reset download token – Webshare API Docs](#reset-download-token-webshare-api-docs) - [Purchase a plan – Webshare API Docs](#purchase-a-plan-webshare-api-docs) - [Customization options – Webshare API Docs](#customization-options-webshare-api-docs) - [Retention offer – Webshare API Docs](#retention-offer-webshare-api-docs) - [Pending Payments – Webshare API Docs](#pending-payments-webshare-api-docs) - [Get a user – Webshare API Docs](#get-a-user-webshare-api-docs) - [Get download token – Webshare API Docs](#get-download-token-webshare-api-docs) - [Create a user – Webshare API Docs](#create-a-user-webshare-api-docs) - [Refresh proxy list of a user – Webshare API Docs](#refresh-proxy-list-of-a-user-webshare-api-docs) - [Update a Sub-user – Webshare API Docs](#update-a-sub-user-webshare-api-docs) - [List proxy activity – Webshare API Docs](#list-proxy-activity-webshare-api-docs) - [Referral Channels – Webshare API Docs](#referral-channels-webshare-api-docs) - [List users – Webshare API Docs](#list-users-webshare-api-docs) - [Billing Information – Webshare API Docs](#billing-information-webshare-api-docs) - [List transactions – Webshare API Docs](#list-transactions-webshare-api-docs) - [Referral Earn out – Webshare API Docs](#referral-earn-out-webshare-api-docs) - [Subscription – Webshare API Docs](#subscription-webshare-api-docs) - [Payments & Billing – Webshare API Docs](#payments-billing-webshare-api-docs) - [Referral Credits – Webshare API Docs](#referral-credits-webshare-api-docs) - [Pricing – Webshare API Docs](#pricing-webshare-api-docs) - [Payment Methods – Webshare API Docs](#payment-methods-webshare-api-docs) - [Referral & Affiliate – Webshare API Docs](#referral-affiliate-webshare-api-docs) - [Coupon Code – Webshare API Docs](#coupon-code-webshare-api-docs) - [Plans – Webshare API Docs](#plans-webshare-api-docs) --- # Proxy Server API – Webshare API Docs Introduction Proxy Server API ================ Introduction[](https://apidocs.webshare.io/#introduction) ---------------------------------------------------------- The Webshare API follows the principles of Representational State Transfer (REST) architecture. It has been designed to provide predictable resource-oriented URLs, accept JSON-encoded request bodies, return JSON-encoded responses, and use standard HTTP response codes, authentication, and verbs. One of the key features of the Webshare API is its support for backwards compatibility, which ensures that any changes made to the API are always backwards compatible. This means that clients using previous versions of the API will not be affected by the updates. In addition to its features, the Webshare API also provides language examples. You can find these code examples on the every feature's page. To switch between the two programming languages, use the tabs located in the top right corner. By leveraging the Webshare API, developers can easily integrate Webshare's functionality into their applications, allowing them to enhance their users' experience and increase the efficiency of their workflow. Authentication[](https://apidocs.webshare.io/#authentication) -------------------------------------------------------------- Authenticated Request Example. Webshare API uses token to allow access to the API. You will receive token after a successful login request. Alternatively, you can register a new Webshare API key at our [API keys (opens in a new tab)](https://proxy.webshare.io/userapi/keys) page. Webshare API expects for the token to be included in all API requests to the server in a header that looks like the following: `Authorization: Token ` PythonJavascriptCURL example.py import requests requests.get( "https://proxy.webshare.io/api/v2/profile/", headers={ "Authorization": "Token APIKEY" } ) ℹ️ You can create your API Keys on your [Dashboard (opens in a new tab)](https://dashboard.webshare.io/userapi/keys) page. Pagination[](https://apidocs.webshare.io/#pagination) ------------------------------------------------------ The Webshare API uses pagination on some of its resource endpoints. The following GET query parameters are used to determine the current `page` and the `page_size`. Some APIs which has streaming activity may opt to use `starting_after` instead of the `page` field. In either case, the `page_size` field is available. Request parameters[](https://apidocs.webshare.io/#request-parameters) ---------------------------------------------------------------------- You can add the request parameters as part of your URL. | Parameter | | Description | | --- | --- | --- | | `page_size` | | Number of elements returned in a page. Default page size is 25 (Optional field). | | `page` | | The current page to retrieve. Default page is 1 (Optional field). | | `starting_after` | | The ID of the last element of the current page. Default is `null` which means the most recent items. (Optional field). | ### Response format[](https://apidocs.webshare.io/#response-format) Response is in JSON object format with the following fields. | Field | | Description | | --- | --- | --- | | `count` | | Total number of elements which are paginated. | | `next` | | Full URL to the next page API resource. If there is no next page, set to `null`. | | `previous` | | Full URL to the previous page API resource. If there is no previous page, set to `null`. If a page is using `starting_after` for pagination, `previous` field will not be available. | | `results` | | List of elements which are paginated. If `page_size` is 25, you can expect up to 25 elements in the results. | ### Example[](https://apidocs.webshare.io/#example) PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/list/?page=4&page_size=10" ) response.json() response.json { "count": 35, "next": null, "previous": "https://proxy.webshare.io/api/v2/proxy/list/?page=3&page_size=10", "results": [\ { ... },\ { ... },\ { ... }\ ] } Rate Limits[](https://apidocs.webshare.io/#rate-limits) -------------------------------------------------------- The server will respond with an HTTP status code of 429 when the rate limit has been exceeded. To prevent this error, it may be necessary to decrease the frequency of requests. It is require to wait for 60 seconds before making a new request. The Webshare API uses rate limits for various endpoints. | API Name | | Rate | | --- | --- | --- | | `General API` | | 240 requests every minute. | | `Proxy List Download Links` | | 30 requests every minute. | | `Proxy List Endpoints` | | 60 requests every minute. | | `Pricing Endpoints` | | 60 requests every minute. | ⚠️ Authentication and other security-sensitive endpoints may have stricter rate limits to protect account security. Filtering & Ordering[](https://apidocs.webshare.io/#filtering--ordering) ------------------------------------------------------------------------- The Webshare API uses filtering, search and ordering on list resource endpoints. The following GET query parameters are used to determine the ordering and filtering. Ordering[](https://apidocs.webshare.io/#ordering) -------------------------------------------------- You can order a list resource endpoint by some fields available in the instance object. For example, integer and date fields can be commonly used for ordering. You can combine multiple ordering fields and change ASC/DESC order. ### Request parameters[](https://apidocs.webshare.io/#request-parameters) You can add the request parameters as part of your URL. | Query | Type | Description | | --- | --- | --- | | `ordering` | | Comma separated name of the fields. Default ordering is ascending. Minus indicates descending order | ### Examples[](https://apidocs.webshare.io/#examples) PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/transaction/?ordering=status,-created_at" ) response.json() Filtering[](https://apidocs.webshare.io/#filtering) ---------------------------------------------------- You can filter list resource endpoints by exact, greater than, less than and contains methods. ### Exact match[](https://apidocs.webshare.io/#exact-match) Match the field to the given value. Can be used for any field type. ?status=completed ### Multi match[](https://apidocs.webshare.io/#multi-match) Match the field to the given value. Can be used for any field type. Multiple values can be comma separated. ?status__in=completed,refunded ### Greater than[](https://apidocs.webshare.io/#greater-than) Retrieve the fields with greater than given value. Can be used for datetime and number fields. `?amount__gt=1337` ### Less than[](https://apidocs.webshare.io/#less-than) Retrieve the fields with less than given value. Can be used for datetime and number fields. `?amount__lt=1337` ### Contains match[](https://apidocs.webshare.io/#contains-match) Check if the given value is in the field. Can be used for string fields only. `?status__contains=completed` ### Examples[](https://apidocs.webshare.io/#examples-1) PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/payment/transaction/?status=completed,refunded&amount__lt=1337" ) response.json() Search[](https://apidocs.webshare.io/#search) ---------------------------------------------- You can perform text search on resource endpoints. Generally, only the text fields will be included as part of the search. PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/transaction/?search=Free" ) response.json() | Query | Type | Description | | --- | --- | --- | | `search` | | The text search parameter. | Errors[](https://apidocs.webshare.io/#errors) ---------------------------------------------- The Webshare API uses the following error codes: | Error | Type | Description | | --- | --- | --- | | `400` | `Bad Request` | Your request is invalid. Check the response body to see why. | | `401` | `Unauthorized` | Your authentication token is wrong. Re-login with your user credentials. | | `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. | | `429` | `Rate limited` | you have reached to the [maximum number of requests](https://apidocs.webshare.io/#rate-limits)
you are allowed to send. Try again later. | | `5xx` | `Server Error` | We had a problem with our server. We have been notified and working on fixing the issue. Try again later. | For `400 Bad Request` validation errors, the response body maps each invalid field to a list of error objects with a human-readable `message` and a machine-readable `code`: { "mode": [\ {\ "message": "This field is required.",\ "code": "required"\ }\ ] } Federated Access[](https://apidocs.webshare.io/#federated-access) ------------------------------------------------------------------ Federated access is only available to Webshare administrators. Add the `X-Webshare-Federated-Access` header to your API calls to retrieve data as a particular user. import requests response = requests.get("https://proxy.webshare.io/api/v2/profile/", headers={ "Authorization": "Token APIKEY", "X-Webshare-Federated-Access": "" }) response.json() [MCP Server](https://apidocs.webshare.io/mcp "MCP Server") --- # MCP Server – Webshare API Docs MCP Server MCP Server ========== The Webshare MCP server connects AI agents to your Webshare account through the [Model Context Protocol (opens in a new tab)](https://modelcontextprotocol.io/) . Add it to Claude, Cursor or any other MCP client, and your agent can list your proxies, check bandwidth and errors, replace proxies, manage IP authorizations and answer questions about your plan and billing. It is a hosted server, so there is nothing to install. You sign in with your Webshare account through OAuth, so you don't need an API key. * **Server URL:** `https://mcp.webshare.io/` * **Transport:** Streamable HTTP * **Authentication:** OAuth, discovered from the server. No API key or headers needed. * **MCP Registry:** listed as `io.webshare/mcp` Connect your client[](https://apidocs.webshare.io/mcp#connect-your-client) --------------------------------------------------------------------------- Pick your client and follow its steps. The same steps are on the [MCP Server (opens in a new tab)](https://dashboard.webshare.io/integrations/mcp) page of your dashboard. Claude CodeClaude Desktop & claude.aiCursorOther clients Run this in your terminal, from your project directory: terminal claude mcp add --transport http webshare https://mcp.webshare.io/ Then start Claude Code, run `/mcp`, select `webshare` and choose **Authenticate**. Allow access[](https://apidocs.webshare.io/mcp#allow-access) ------------------------------------------------------------- The first time your client connects, it opens Webshare in your browser: 1. Log in to Webshare if asked. 2. Check the app name and the [permissions](https://apidocs.webshare.io/mcp#permissions) it asks for. Clients ask for read access. Tick the **Write** permissions too if you want your agent to make changes. 3. Click **Allow Access**. Your browser sends you back to your client, and the connection is ready. Only the account owner can connect apps. If you are logged in as a sub-user or with a staff session, the consent screen shows **Only the account owner can connect apps**. Use **Switch Account** to log in as the owner. The consent screen shows most clients as **Not verified by Webshare**. This is expected: Claude Code, Claude, Cursor and most other clients register themselves when they first connect. Check that the app name is the one you are connecting and that it returns you where you expect. Claude Code, for example, shows **Returns you to localhost on this computer**. The consent link is valid for 10 minutes and can be used once. If you see **This link has expired**, go back to your client and start the connection again. ### Test your connection[](https://apidocs.webshare.io/mcp#test-your-connection) Ask your agent one of these to check that everything works: * List my Webshare proxies grouped by country. * Find proxies that failed more than 5% in the last 24 hours and suggest replacements. * What's my projected bandwidth usage this month compared to my current plan? Permissions[](https://apidocs.webshare.io/mcp#permissions) ----------------------------------------------------------- Each connection only gets the permissions (OAuth scopes) you allowed on the consent screen. Your agent only sees the [tools](https://apidocs.webshare.io/mcp#tools) those permissions cover, and calls to any other tool are refused. | Scope | Access | What it allows | | --- | --- | --- | | `proxy:read` | `Read` | Proxy list, configuration, statistics and replacement history. | | `account:read` | `Read` | Profile, subscription and plans, notifications and verifications. | | `billing:read` | `Read` | Billing details, payments and payment methods. | | `catalog:read` | `Read` | Webshare products and pricing. | | `proxy:write` | `Write` | Refresh the proxy list, replace proxies, allocate unallocated proxies and change IP authorizations. | | `billing:write` | `Write` | Cancel auto-renewal and remove the saved payment method. | Clients ask for the four read scopes, and those are ticked on the consent screen. The write scopes are listed but not ticked. Tick them only if you want your agent to change your proxies or billing. You can also untick scopes you don't want to give, as long as at least one stays ticked. To change the permissions of a connected app later, [disconnect it](https://apidocs.webshare.io/mcp#disconnect-an-app) and connect it again. No permission lets an agent buy, renew or upgrade a plan, add a payment method, manage API keys, or change your login and security settings. Those stay in the dashboard. Tools[](https://apidocs.webshare.io/mcp#tools) ----------------------------------------------- These are the tools your agent can call. The **Scope** column shows the permissions each tool needs. Tools that need a `write` scope change your account. ### Account & billing[](https://apidocs.webshare.io/mcp#account--billing) | Tool | Scope | Description | | --- | --- | --- | | `get_profile` | `account:read` | Your profile: name, email and account details. | | `get_subscription` | `account:read` | Subscription summary: term, current period, auto-renewal, credits, and whether it is paused or throttled. | | `list_plans` | `account:read` | All your plans (active, expired and cancelled) with proxy counts, countries, bandwidth, prices and quotas. | | `get_plan` | `account:read` | One plan in detail. | | `get_billing_info` | `billing:read` | Billing name, postal address and billing email. | | `list_payment_methods` | `billing:read` | Saved payment methods: type, brand, last 4 digits and expiry. | | `list_pending_payments` | `billing:read` | Pending and failed payment attempts, with the reason a payment failed. | | `list_transactions` | `billing:read` | Billing history: charges, refunds and credits. | | `diagnose_billing_issue` | `account:read billing:read` | Checks payments, payment methods, subscription state, verifications and suspension in one call, and lists any problems found, most urgent first. | | `cancel_auto_renewal` | `account:read billing:write` | Turns off auto-renewal for the whole subscription and clears the payment method. Your plans keep working until the end of the current period. | | `remove_payment_method` | `account:read billing:write` | Removes the saved card. Only works when no paid plan is active. | ### Usage & statistics[](https://apidocs.webshare.io/mcp#usage--statistics) | Tool | Scope | Description | | --- | --- | --- | | `get_bandwidth_stats` | `proxy:read` | Bandwidth use and request counts for one or more plans, with an optional date range. | | `get_error_stats` | `proxy:read` | Error counts and a breakdown by reason for one or more plans, with troubleshooting guidance. | ### Proxies & configuration[](https://apidocs.webshare.io/mcp#proxies--configuration) | Tool | Scope | Description | | --- | --- | --- | | `list_proxies` | `proxy:read` | Proxies on a plan, filtered by country, validity, ASN or address. | | `get_proxy_config` | `proxy:read` | A plan's proxy configuration: country allocation, connection mode, rotation and authentication settings. | | `get_proxy_config_stats` | `proxy:read` | Available countries, IP ranges and ASNs for a plan. | | `get_proxy_config_status` | `proxy:read` | Allocation state, country allocations and proxy credentials for a plan. | | `refresh_proxy_list` | `proxy:write` | Replaces a plan's proxies with new ones from the pool. Uses the plan's refresh quota. | | `allocate_unallocated_countries` | `proxy:write` | Moves a plan's unallocated proxies into the countries you choose. | ### Proxy replacements[](https://apidocs.webshare.io/mcp#proxy-replacements) | Tool | Scope | Description | | --- | --- | --- | | `list_proxy_replacements` | `proxy:read` | Replacement requests on a plan, including automatic ones. | | `get_proxy_replacement` | `proxy:read` | One replacement request and its current state. | | `list_replaced_proxies` | `proxy:read` | Proxies that were replaced on a plan, what replaced them and why. | | `create_proxy_replacement` | `proxy:write` | Replaces proxies on a plan by country, IP range or IP address. Supports a dry run to preview the change first. Uses replacement credits and cannot be undone. | ### IP authorization[](https://apidocs.webshare.io/mcp#ip-authorization) | Tool | Scope | Description | | --- | --- | --- | | `list_ip_authorizations` | `proxy:read` | IP addresses authorized on a plan, with when each was added and last used. | | `get_ip_authorization` | `proxy:read` | One IP authorization. | | `create_ip_authorization` | `proxy:write` | Authorizes a public IPv4 address on a plan. Takes effect immediately. | | `delete_ip_authorization` | `proxy:write` | Removes an IP authorization. Connections from that IP stop working right away. | ### Notifications[](https://apidocs.webshare.io/mcp#notifications) | Tool | Scope | Description | | --- | --- | --- | | `list_notifications` | `account:read` | Your dashboard notifications, such as bandwidth alerts and renewal reminders. | | `get_notification` | `account:read` | One notification in detail. | ### Products & pricing[](https://apidocs.webshare.io/mcp#products--pricing) | Tool | Scope | Description | | --- | --- | --- | | `list_proxy_catalog` | `catalog:read` | The proxy products Webshare sells. | | `get_customize_options` | `catalog:read` | Configuration limits and live country availability for a product. | | `get_pricing` | `catalog:read` | A price quote for a proxy configuration, monthly and yearly. | Disconnect an app[](https://apidocs.webshare.io/mcp#disconnect-an-app) ----------------------------------------------------------------------- Every app you allow shows up on the [Connected Apps (opens in a new tab)](https://dashboard.webshare.io/integrations/connected-apps) page of your dashboard, with the date you allowed it and its read and write access. To remove an app's access, click **Disconnect** next to it and confirm. The app loses all access right away. You may be asked for your two-factor authentication code. To use the app again, connect it again. Only the account owner can see and disconnect connected apps. [Introduction](https://apidocs.webshare.io/ "Introduction") [CLI & SDKs](https://apidocs.webshare.io/cli-sdks "CLI & SDKs") --- # Local Account – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Local account Local Account ============= This endpoint enables registering and login with email and password. The email address verification (e.g. click on a link to verify email) is not part of this API. The token retrieved from both the register and login endpoints can be used to authorize API requests. Register a Local Account[](https://apidocs.webshare.io/registerandlogin/local-account#register-a-local-account) ---------------------------------------------------------------------------------------------------------------- You can register for a new account using the API requests as follows. ℹ️ This API endpoint requires recaptcha validation. This means that you should not be using this API endpoint programmatically and only use it from the [Webshare Dashboard](https://proxy.webshare.io/dashboard/) . POST https://proxy.webshare.io/api/v2/register/ | Parameter | Type | Description | | --- | --- | --- | | `email` | `string` | Email address to register with. May require email validation (e.g. click the link) later on. | | `password` | `string` | Password requirements are: 8 characters minimum, not too similar to the email, must not be all numeric, must not be a common password. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | | `tos_accepted` | `boolean` | Must be `true` to process the request. | | `marketing_email_accepted` | `boolean` | Whether the service should send marketing emails to the customers. | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/local-account#request--response) PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/register/", json={ "email": "user@webshare.io", "password": "password", "recaptcha": "...", "tos_accepted": True, "marketing_email_accepted": True, } ) response.json() The commands above return JSON structured like this: response.json { "token": "...", "logged_in_existing_user": false } Sign in with Local Account[](https://apidocs.webshare.io/registerandlogin/local-account#sign-in-with-local-account) -------------------------------------------------------------------------------------------------------------------- You can login to an existing account using the API requests as follows. ℹ️ This API endpoint requires recaptcha validation. This means that you should not be using this API endpoint programmatically and only use it from the [Webshare Dashboard](https://proxy.webshare.io/dashboard/) . POST https://proxy.webshare.io/api/v2/login/ | Parameter | Type | Description | | --- | --- | --- | | `email` | `string` | Email address previously registered with. | | `password` | `string` | Password previously registered with. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/local-account#request--response-1) PythonJavascriptcURL login.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/login/", json={ "email": "user@webshare.io", "password": "password", "recaptcha": "..." } ) response.json() The commands above return JSON structured like this: response.json { "token": "..." } [Registration and Login](https://apidocs.webshare.io/registerandlogin "Registration and Login") [Social account](https://apidocs.webshare.io/registerandlogin/social-account "Social account") --- # Reset Password – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Reset password Reset Password ============== This endpoint enables sending API calls for a new password reset request and complete an existing password reset with a `password_reset_token` retrieved from the email. Reset Password Request[](https://apidocs.webshare.io/registerandlogin/reset-password#reset-password-request) ------------------------------------------------------------------------------------------------------------- Request a new password reset for a user. If successful, the API send an email to the user. Beyond basic email/recaptcha validation, this API always returns 204 response even if the email is not found. Email validation only checks if the given email is in the correct format. POST https://proxy.webshare.io/api/v2/resetpassword/ | Parameter | Type | Description | | --- | --- | --- | | `email` | `string` | Email of the existing user. Email validation only checks if the given email is in the correct format. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/reset-password#request--response) PythonJavascriptcURL reset\_password\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/resetpassword/", json={ "email": "user@webshare.io", "recaptcha": "..." } ) response.json() the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content Complete Password Request[](https://apidocs.webshare.io/registerandlogin/reset-password#complete-password-request) ------------------------------------------------------------------------------------------------------------------- Complete the password reset using the `password_reset_token` retrieved from the email. If password reset is successful, all previous API tokens will be invalidated and you will receive a new token. The reset password email contains a link which redirects to the following URL: POST https://dashboard.webshare.io/resetpassword/{password_reset_token}/confirm/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/reset-password#request--response-1) The password `password_reset_token` field is used for completing password reset. PythonJavascriptcURL reset\_password\_complete.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/resetpassword/complete/", json={ "password": "newpassword1234", "password_reset_token": "aabb...99", "recaptcha": "..." } ) response.json() The commands above return JSON structured like this: response.json { "token": "..." } [Change password](https://apidocs.webshare.io/registerandlogin/change-password "Change password") [Change email](https://apidocs.webshare.io/registerandlogin/change-email "Change email") --- # Social Account – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Social account Social Account ============== This endpoint enables registering and login with social account (e.g. Google OAuth2). The token retrieved from both the register and login endpoints can be used to authorize API requests. Register a Social Account[](https://apidocs.webshare.io/registerandlogin/social-account#register-a-social-account) ------------------------------------------------------------------------------------------------------------------- You can register for a new account using the API requests as follows. POST https://proxy.webshare.io/api/v2/register/social/ | Parameter | Type | Description | | --- | --- | --- | | `provider` | `string` | Social provider to login with. Currently only `google` is supported. | | `code` | `string` | Then auth code received from the social provider. | | `redirect_uri` | `string` | Must match the authorized redirect URIs [Google Credentials](https://console.cloud.google.com/apis/credentials/oauthclient/186704426882-l16ev1p3h8eai6btjq3b929csie3kgm5.apps.googleusercontent.com?project=webshareio-login)
. | | `tos_accepted` | `boolean` | Must be `true` to process the request. | | `marketing_email_accepted` | `boolean` | Whether the service should send marketing emails to the customers. | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/social-account#request--response) PythonJavascriptcURL register.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/register/social/", json={ "provider": "google", "code": "XXXX", "redirect_uri": "https://dashboard.webshare.io", "tos_accepted": True, "marketing_email_accepted": True, } ) response.json() The commands above return JSON structured like this: response.json { "token": "...", "logged_in_existing_user": false } Login with a Social Account[](https://apidocs.webshare.io/registerandlogin/social-account#login-with-a-social-account) ----------------------------------------------------------------------------------------------------------------------- You can login to an existing social account using the API requests as follows. POST https://proxy.webshare.io/api/v2/login/social/ | Parameter | Type | Description | | --- | --- | --- | | `provider` | `string` | | | `code` | `string` | Then auth code received from the social provider. | | `redirect_uri` | `string` | | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/social-account#request--response-1) PythonJavascriptcURL login.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/login/social/", json={ "provider": "google", "code": "XXXX", "redirect_uri": "https://dashboard.webshare.io", } ) response.json() The commands above return JSON structured like this: response.json { "token": "..." } [Local account](https://apidocs.webshare.io/registerandlogin/local-account "Local account") [Change password](https://apidocs.webshare.io/registerandlogin/change-password "Change password") --- # Change Email – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Change email Change Email ============ This endpoint enables sending API calls for an email change request and complete an existing change request with a `confirmation_code` retrieved from the email. Change Email Request[](https://apidocs.webshare.io/registerandlogin/change-email#change-email-request) ------------------------------------------------------------------------------------------------------- Request a new email change for a user. If successful, the API sends an email to the user. Beyond email uniqueness validation, this API always returns 204 response. Email validation checks if the email exists in the system. POST https://proxy.webshare.io/api/v2/changeemail/ | Parameter | Type | Description | | --- | --- | --- | | `password` | `string` | Password of the user. | | `new_email` | `string` | New email address we are switching to to. Email validation checks if the email already exists in the system. | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/change-email#request--response) PythonJavascriptcURL change\_email\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/changeemail/", json={ "password": "newpassword1234", "new_email": "newemail@webshare.io" }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 204 the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content Complete Email Change[](https://apidocs.webshare.io/registerandlogin/change-email#complete-email-change) --------------------------------------------------------------------------------------------------------- Complete the change email request using the `confirmation_code` retrieved from the email. The change email contains a link which redirects to the following URL: GET https://dashboard.webshare.io/changeemail/{confirmation_code}/confirm/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/change-email#request--response-1) **Important** * The user must be logged into their account to complete the change email request. * `confirmation_code` field is used for completing change email request. PythonJavascriptcURL change\_email\_complete.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/changeemail/complete/", json={ "confirmation_code": "XXXX" }, headers={"Authorization": "Token APIKEY"} ) response.json() the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content [Reset password](https://apidocs.webshare.io/registerandlogin/reset-password "Reset password") [Activate account](https://apidocs.webshare.io/registerandlogin/activate-account "Activate account") --- # Activate Account – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Activate account Activate Account ================ Accounts in some cases may require email activation before being able to do certain actions. You can activate or resend activation emails using the APIs below. Activation Status Object[](https://apidocs.webshare.io/registerandlogin/activate-account#activation-status-object) ------------------------------------------------------------------------------------------------------------------- | Attributes | Types | Description | | --- | --- | --- | | `email_is_verified` | `boolean` | Whether the email is verified or not. | | `last_time_email_verification_email_sent` | `string` | Last time the account activation email was sent. May be `null`. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format with timestamp. | | `created_at` | `string` | The time the activation status object was created. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format with timestamp. | | `updated_at` | `string` | The last time the activation status was updated. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format with timestamp. | Get Activation Status[](https://apidocs.webshare.io/registerandlogin/activate-account#get-activation-status) ------------------------------------------------------------------------------------------------------------- This endpoint retrieves the current state of the account activation. GET https://proxy.webshare.io/api/v2/activation/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/activate-account#request--response) PythonJavascriptcURL get\_activation\_status.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/activation/", headers={ "Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "email_is_verified": false, "last_time_email_verification_email_sent": null, "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00" } Resend Activation Email[](https://apidocs.webshare.io/registerandlogin/activate-account#resend-activation-email) ----------------------------------------------------------------------------------------------------------------- This endpoint re-sends activation email to the user's registered email address. There is a limit on how often a user can re-send activation emails. The API returns the Activation Status object on success. POST https://proxy.webshare.io/api/v2/activation/resend/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/activate-account#request--response-1) The request does not contain a body. PythonJavascriptcURL resend\_activation\_email.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/activation/resend/", json={}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "email_is_verified": false, "last_time_email_verification_email_sent": "2019-05-09T23:34:00.095501-07:00", "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00" } Complete Account Activation[](https://apidocs.webshare.io/registerandlogin/activate-account#complete-account-activation) ------------------------------------------------------------------------------------------------------------------------- Use the activation token you have received from the email to complete the account activation. A successful activation will return you a new API token. You can still continue using your existing API token. This API doesn't require authentication headers, although you are encouraged to send the headers. The email contains a link which redirects to the following URL: POST https://dashboard.webshare.io/activation/{activation_token}/confirm/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/activate-account#request--response-2) | Parameter | Type | Description | | --- | --- | --- | | `activation_token` | `string` | Activation token retrieved from the email. | POST https://proxy.webshare.io/api/v2/activation/complete/ `activation_token` field is used for completing account activation. PythonJavascriptcURL complete\_activation.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/activation/complete/", json={ "activation_token": "XXXX" } ) response.json() The commands above return JSON structured like this: response.json { "token": "..." } [Change email](https://apidocs.webshare.io/registerandlogin/change-email "Change email") [Delete account](https://apidocs.webshare.io/registerandlogin/delete-account "Delete account") --- # CLI & SDKs – Webshare API Docs CLI & SDKs CLI & SDKs ========== Webshare publishes an official command-line interface and SDKs for Node.js, Python and Go. They are built on this API and open source on [GitHub (opens in a new tab)](https://github.com/webshare-proxy) . CLI[](https://apidocs.webshare.io/cli-sdks#cli) ------------------------------------------------ `webshare` is the official command-line interface. It lists and exports proxies, builds proxy URLs, shows usage statistics and manages IP authorizations, plans and sub-users. ### Install[](https://apidocs.webshare.io/cli-sdks#install) macOSLinuxWindowsFrom source Install with [Homebrew (opens in a new tab)](https://brew.sh/) : terminal brew install webshare-proxy/tap/webshare Each release includes a `checksums.txt` file to verify the download. ### Authenticate[](https://apidocs.webshare.io/cli-sdks#authenticate) Browser loginAPI key Sign in through your browser: terminal webshare login webshare whoami `login` opens the Webshare consent screen and asks for the access the CLI's commands need. The CLI stores the token in your operating system's keychain, or in a file only you can read when there is no keychain. The token refreshes by itself. The CLI then shows up on the [Connected Apps (opens in a new tab)](https://dashboard.webshare.io/integrations/connected-apps) page of your dashboard. Run `webshare logout` to revoke the login. ### Run your first command[](https://apidocs.webshare.io/cli-sdks#run-your-first-command) terminal # Check who you're logged in as webshare whoami # Export your proxy list as CSV webshare proxies list --format csv --limit 0 > proxies.csv # See bandwidth and request stats webshare stats # Make a request through a rotating proxy curl --proxy "$(webshare proxy-url --rotate)" https://ipv4.webshare.io/ On a terminal the output is a table. In a pipe it is plain text with no headers or colors, and `--json` gives JSON. Commands that work on a plan accept `--plan` and use your active plan without it. See the [CLI README (opens in a new tab)](https://github.com/webshare-proxy/webshare-cli#readme) for every command. SDKs[](https://apidocs.webshare.io/cli-sdks#sdks) -------------------------------------------------- The SDKs wrap this API with typed clients. They read your [API key](https://apidocs.webshare.io/apikeys) from the `WEBSHARE_API_KEY` environment variable. Node.jsPythonGo Requires Node.js 20 or newer. Ships ESM and CommonJS builds with TypeScript types. terminal npm install @webshare-proxy/sdk example.mjs import { Webshare } from '@webshare-proxy/sdk' const client = new Webshare() // reads WEBSHARE_API_KEY const page = await client.proxies.list({ mode: 'direct' }) console.log(page.results[0]) [npm (opens in a new tab)](https://www.npmjs.com/package/@webshare-proxy/sdk) · [GitHub (opens in a new tab)](https://github.com/webshare-proxy/webshare-node) Most proxy operations are scoped to a plan. Without a plan ID, the API uses your account's default plan. To pick one, list your plans and pass the plan's ID. Each SDK's README on GitHub shows how. [MCP Server](https://apidocs.webshare.io/mcp "MCP Server") [Registration and Login](https://apidocs.webshare.io/registerandlogin "Registration and Login") --- # Registration and Login – Webshare API Docs Registration and Login Registration and Login ====================== Webshare API supports both social and username/password based login and registration. Webshare API also supports social login with Google Auth. [CLI & SDKs](https://apidocs.webshare.io/cli-sdks "CLI & SDKs") [Local account](https://apidocs.webshare.io/registerandlogin/local-account "Local account") --- # Delete Account – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Delete account Delete Account ============== Please note that some data generated by the account (e.g. activity logs and transaction history) may be retained. You can view [Webshare Privacy Policy (opens in a new tab)](https://www.webshare.io/privacy-policy) for more information on how your data is processed by Webshare. This endpoint deletes your Webshare account. Delete Account Request[](https://apidocs.webshare.io/registerandlogin/delete-account#delete-account-request) ------------------------------------------------------------------------------------------------------------- This API endpoint requires a recaptcha validation. This means that you should not be using this API endpoint programmatically and only use it from the Webshare Dashboard. POST https://proxy.webshare.io/api/v2/deleteaccount/ | Parameter | Type | Description | | --- | --- | --- | | `password` | `string` | Password of the user. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | If request is successful, the API deletes the user. A successful request returns 204 response ### Request & Response[](https://apidocs.webshare.io/registerandlogin/delete-account#request--response) PythonJavascriptcURL delete\_account.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/deleteaccount/", json={ "password": "newpassword1234", "recaptcha": "..." }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 204 the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content ### Account deleted[](https://apidocs.webshare.io/registerandlogin/delete-account#account-deleted) If your account is deleted, all API requests will start returning the `403 Forbidden` status with the following error message. HTTP/1.1 403 Forbidden { "detail": "Your account is deleted.", "code": "account_deleted" } [Activate account](https://apidocs.webshare.io/registerandlogin/activate-account "Activate account") [Delete social account](https://apidocs.webshare.io/registerandlogin/delete-social-account "Delete social account") --- # Delete Social Account – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Delete social account Delete Social Account ===================== Please note that some data generated by the account (e.g. activity logs and transaction history) may be retained. You can view [Webshare Privacy Policy (opens in a new tab)](https://www.webshare.io/privacy-policy) for more information on how your data is processed by Webshare. This endpoint deletes your Webshare social account. Delete Social Account Request[](https://apidocs.webshare.io/registerandlogin/delete-social-account#delete-social-account-request) ---------------------------------------------------------------------------------------------------------------------------------- POST https://proxy.webshare.io/api/v2/deleteaccount/social/ | Parameter | Type | Description | | --- | --- | --- | | `provider` | `string` | Social provider to login with. Currently only `google` is supported. | | `code` | `string` | Then auth code received from the social provider. | | `redirect_uri` | `string` | Must match the authorized redirect URIs [Google Credentials](https://console.cloud.google.com/apis/credentials/oauthclient/186704426882-l16ev1p3h8eai6btjq3b929csie3kgm5.apps.googleusercontent.com?project=webshareio-login)
. | If request is successful, the API deletes the user. A successful request returns 204 response ### Request & Response[](https://apidocs.webshare.io/registerandlogin/delete-social-account#request--response) PythonJavascriptcURL delete\_account.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/deleteaccount/social/", json={ "provider": "google", "code": "XXXX", "redirect_uri": "https://dashboard.webshare.io", }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 204 the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content ### Account deleted[](https://apidocs.webshare.io/registerandlogin/delete-social-account#account-deleted) If your account is deleted, all API requests will start returning the `403 Forbidden` status with the following error message. HTTP/1.1 403 Forbidden { "detail": "Your account is deleted.", "code": "account_deleted" } [Delete account](https://apidocs.webshare.io/registerandlogin/delete-account "Delete account") [Logout](https://apidocs.webshare.io/registerandlogin/logout "Logout") --- # Logout – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Logout Logout ====== You can logout to invalidate the token you are using. POST https://proxy.webshare.io/api/v2/logout/ ### Request & Response[](https://apidocs.webshare.io/registerandlogin/logout#request--response) PythonJavascriptcURL logout.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/logout/", headers={ "Authorization": "Token APIKEY" } ) response.json() the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content [Delete social account](https://apidocs.webshare.io/registerandlogin/delete-social-account "Delete social account") [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth "Two-Factor Auth") --- # Two factor authentication (2FA) – Webshare API Docs Two-Factor Auth Two factor authentication (2FA) =============================== Webshare requires two factor authentication on all of its endpoints. This section explains how to enter the 2FA code when it is required, and how to enroll new 2FA devices for your account. Webshare currently supports following 2FA methods: * Email: Enabled by default on your account. * TOTP: You can enroll a TOTP device (e.g. Google Authenticator, Authy) to generate 2FA codes. The 2FA only applies to login tokens. API tokens are not affected by 2FA. The 2FA endpoints themselves cannot be called with an API key — they require a login token; calling them with an API key returns 403 Forbidden with the `api_key_not_allowed` error code. When to enter 2FA?[](https://apidocs.webshare.io/twofactorauth#when-to-enter-2fa) ---------------------------------------------------------------------------------- You will receive 403 Forbidden response from any API with the following message when 2FA is required: { "detail": "Two factor authentication is needed.", "code": "2fa_needed" } If email 2FA method is used, you will receive an email with the 2FA code as soon as you receive the 403 response. ### 2FA Method object[](https://apidocs.webshare.io/twofactorauth#2fa-method-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `number` | Unique identifier of the 2FA method instance | | `type` | `string` | The type of 2FA method. Valid values: `email_code` or `device_totp`. | | `active` | `boolean` | Whether this is the active 2FA for the account. Each account has 1 active 2FA method. | | `secret_key` | `string` | Hex formatted secret key for TOTP device. Only shown right after creating a `device_totp`. Otherwise this field is hidden. | | `created_at` | `string` | The date the 2FA method was created. (Read-only) | | `updated_at` | `string` | The date the 2FA method was last updated. (Read-only) | ### In JSON format[](https://apidocs.webshare.io/twofactorauth#in-json-format) twofactorauthmethod.json { "id": 137, "type": "email_code", "active": true, "secret_key": "WMYX3M3A5UML5Y2ZVL7ABLGIRFY3X4H5", "created_at": "2023-03-04T05:34:35.553059-08:00", "updated_at": "2023-03-04T05:34:35.553059-08:00" } [Logout](https://apidocs.webshare.io/registerandlogin/logout "Logout") [Enter 2FA Code](https://apidocs.webshare.io/twofactorauth/enter-2fa-code "Enter 2FA Code") --- # Enter 2fa Code – Webshare API Docs [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth) Enter 2FA Code Enter 2FA Code[](https://apidocs.webshare.io/twofactorauth/enter-2fa-code#enter-2fa-code) ------------------------------------------------------------------------------------------ This API lets you enter the 2FA code to authenticate your account. After authenticating your account, you can replay your previously failed request. POST https://proxy.webshare.io/api/v2/twofactorauth/codeauth/ | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | Code received in the email or generated by TOTP device. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Request & Response[](https://apidocs.webshare.io/twofactorauth/enter-2fa-code#request--response) PythonJavascriptcURL change\_email\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/twofactorauth/codeauth/", json={ "code": "164123", "recaptcha": "..." }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 204 the commands above return JSON structured like this: response.json {} [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth "Two-Factor Auth") [Get 2FA Method](https://apidocs.webshare.io/twofactorauth/get-2fa-method "Get 2FA Method") --- # Get 2fa Method – Webshare API Docs [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth) Get 2FA Method Get 2FA Method[](https://apidocs.webshare.io/twofactorauth/get-2fa-method#get-2fa-method) ------------------------------------------------------------------------------------------ Every account by default has 2FA with Email enabled. This API lets you get the active 2FA method for your account. GET https://proxy.webshare.io/api/v2/twofactorauth/method/current/ ### Request & Response[](https://apidocs.webshare.io/twofactorauth/get-2fa-method#request--response) PythonJavascriptcURL get\_2fa\_method\_request.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/twofactorauth/method/current/", headers={"Authorization": "Token APIKEY"} ) response.json() the commands above return JSON structured like this: response.json { "id": 137, "type": "device_totp", "active": true, "created_at": "2023-03-04T05:34:35.553059-08:00", "updated_at": "2023-03-04T05:34:35.553059-08:00" } [Enter 2FA Code](https://apidocs.webshare.io/twofactorauth/enter-2fa-code "Enter 2FA Code") [Change 2FA Method](https://apidocs.webshare.io/twofactorauth/change-2fa-method "Change 2FA Method") --- # Change 2fa Method – Webshare API Docs [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth) Change 2FA Method Change 2FA Method[](https://apidocs.webshare.io/twofactorauth/change-2fa-method#change-2fa-method) --------------------------------------------------------------------------------------------------- You can use this API to change the default 2FA method for your account. * Email method activates instantly. * Device method requires additional steps to complete the activate the new method. POST https://proxy.webshare.io/api/v2/twofactorauth/method/ | Parameter | Type | Description | | --- | --- | --- | | `type` | `string` | Defines the type of 2FA method. Valid values: 'email\_code' or 'device\_totp'. | ### Request & Response[](https://apidocs.webshare.io/twofactorauth/change-2fa-method#request--response) PythonJavascriptcURL change\_2fa\_method\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/twofactorauth/method/", json={ "type": "email_code", }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 200 The commands above return JSON structured like this: response.json { "id": 137, "type": "email_code", "active": true, "created_at": "2023-03-04T05:34:35.553059-08:00", "updated_at": "2023-03-04T05:34:35.553059-08:00" } [Get 2FA Method](https://apidocs.webshare.io/twofactorauth/get-2fa-method "Get 2FA Method") [Activate 2FA Method](https://apidocs.webshare.io/twofactorauth/activate-2fa-method "Activate 2FA Method") --- # Change Password – Webshare API Docs [Registration and Login](https://apidocs.webshare.io/registerandlogin) Change password Change Password =============== This endpoint enables changing your existing password. Reset Password Request[](https://apidocs.webshare.io/registerandlogin/change-password#reset-password-request) -------------------------------------------------------------------------------------------------------------- Change your current password to a new password. Upon a successful password change, all API tokens will be disabled except the current one. If a user has registered with Google Oauth, they may not have a password. In that case, they must use reset password endpoint instead. POST https://proxy.webshare.io/api/v2/changepassword/ | Parameter | Type | Description | | --- | --- | --- | | `password` | `string` | Current password. | | `new_password` | `string` | New password. Must meet all password requirements (similar to registration) | ### Request & Response[](https://apidocs.webshare.io/registerandlogin/change-password#request--response) PythonJavascriptcURL reset\_password\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/changepassword/", json={ "password": "currentpassword", "new_password": "new_password1234" }, headers={"Authorization": "Token APIKEY"} ) response.json() the above command returns empty response with `204 No Content` HTTP/1.1 204 No Content [Social account](https://apidocs.webshare.io/registerandlogin/social-account "Social account") [Reset password](https://apidocs.webshare.io/registerandlogin/reset-password "Reset password") --- # Activate 2fa Method – Webshare API Docs [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth) Activate 2FA Method Activate 2FA Method[](https://apidocs.webshare.io/twofactorauth/activate-2fa-method#activate-2fa-method) --------------------------------------------------------------------------------------------------------- Device method requires additional steps to activate new 2FA method. You can activate the new method by providing the generated codes from the 2FA device. `code_1` and `code_2` cannot be the same. POST https://proxy.webshare.io/api/v2/twofactorauth/method//activate/ | Parameter | Type | Description | | --- | --- | --- | | `code_1` | `string` | Code generated by the 2FA device. | | `code_2` | `string` | Code generated by the 2FA device. | ### Request & Response[](https://apidocs.webshare.io/twofactorauth/activate-2fa-method#request--response) PythonJavascriptcURL activate\_2fa\_method\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/twofactorauth/method//activate/", json={ "code_1": "123456", "code_2": "987654", }, headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 200 The commands above return JSON structured like this: response.json { "id": 137, "type": "device_totp", "active": true, "created_at": "2023-03-04T05:34:35.553059-08:00", "updated_at": "2023-03-04T05:34:35.553059-08:00" } [Change 2FA Method](https://apidocs.webshare.io/twofactorauth/change-2fa-method "Change 2FA Method") [Resend 2FA Email](https://apidocs.webshare.io/twofactorauth/resend-2fa-email "Resend 2FA Email") --- # Resend 2fa Email – Webshare API Docs [Two-Factor Auth](https://apidocs.webshare.io/twofactorauth) Resend 2FA Email Resend 2FA Email[](https://apidocs.webshare.io/twofactorauth/resend-2fa-email#resend-2fa-email) ------------------------------------------------------------------------------------------------ Resend the 2FA code via email in case you didn't receive it. This API is only available for the email 2FA method. POST https://proxy.webshare.io/api/v2/twofactorauth/email/resend/ ### Request & Response[](https://apidocs.webshare.io/twofactorauth/resend-2fa-email#request--response) PythonJavascriptcURL resend\_2fa\_email\_request.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/twofactorauth/email/resend/", headers={"Authorization": "Token APIKEY"} ) assert response.status_code == 200 The commands above return JSON structured like this: response.json { "email_sent": true } [Activate 2FA Method](https://apidocs.webshare.io/twofactorauth/activate-2fa-method "Activate 2FA Method") [User Profile](https://apidocs.webshare.io/userprofile "User Profile") --- # User Profile – Webshare API Docs User Profile User Profile ============ You can use the API to retrieve information about your user preferences. ### User profile object[](https://apidocs.webshare.io/userprofile#user-profile-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `number` | Unique identifier of the profile instance | | `email` | `string` | Email address of the users. (Read-only) | | `is_email_verified` | `boolean` | Whether the user has verified their email address. (Read-only) | | `first_name` | `string` | First name of the user. Can be set to empty. | | `last_name` | `string` | Last name of the user. Can be set to empty. | | `created_at` | `string` | The date user was registered. (Read-only) | | `last_login` | `string` | The date user last logged in. (Read-only) | | `timezone` | `string` | The preferred timezone set by the user. | | `subscribed_bandwidth_usage_notifications` | `boolean` | Subscribed to email notifications for bandwidth usage. | | `subscribed_subscription_notifications` | `boolean` | Subscribed to email notifications for subscription updates. | | `subscribed_proxy_usage_statistics` | `boolean` | Subscribed to email notifications for proxy usage statistics/insights. | | `subscribed_usage_warnings` | `boolean` | Subscribed to email notifications for proxy usage warnings. | | `subscribed_guides_and_tips` | `boolean` | Subscribed to email notifications for guides and tips for your proxy usage. | | `subscribed_survey_emails` | `boolean` | Subscribed to email notifications for surveys. | | `tracking_id` | `string` | Unique ID for this user. May be used while identifying the user with external services. | | `updated_at` | `string` | The date the profile was last updated. (Read-only) | ### In JSON format[](https://apidocs.webshare.io/userprofile#in-json-format) profile.json { "id": 1, "email": "user@webshare.io", "is_email_verified": true, "first_name": "first", "last_name": "last", "last_login": "2022-06-14T15:59:06.663774-07:00", "timezone": "America/Los_Angeles", "subscribed_bandwidth_usage_notifications": true, "subscribed_subscription_notifications": true, "subscribed_proxy_usage_statistics": true, "subscribed_usage_warnings": true, "subscribed_guides_and_tips": true, "subscribed_survey_emails": true, "tracking_id": "...", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Resend 2FA Email](https://apidocs.webshare.io/twofactorauth/resend-2fa-email "Resend 2FA Email") [Retrieve user profile](https://apidocs.webshare.io/userprofile/retrieve "Retrieve user profile") --- # Retrieve – Webshare API Docs [User Profile](https://apidocs.webshare.io/userprofile) Retrieve user profile Retrieve user profile[](https://apidocs.webshare.io/userprofile/retrieve#retrieve-user-profile) ------------------------------------------------------------------------------------------------ This endpoint retrieves the user profile. ### Request & Response[](https://apidocs.webshare.io/userprofile/retrieve#request--response) GET https://proxy.webshare.io/api/v2/profile/ PythonJavascriptcURL get\_profile.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/profile/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json // Example Response { "id": 1, "email": "user@webshare.io", "is_email_verified": true, "first_name": "first", "last_name": "last", "last_login": "2022-06-14T15:59:06.663774-07:00", "timezone": "America/Los_Angeles", "subscribed_bandwidth_usage_notifications": true, "subscribed_subscription_notifications": true, "subscribed_proxy_usage_statistics": true, "subscribed_usage_warnings": true, "subscribed_guides_and_tips": true, "subscribed_survey_emails": true, "tracking_id": "...", ... } [User Profile](https://apidocs.webshare.io/userprofile "User Profile") [Update user profile](https://apidocs.webshare.io/userprofile/update "Update user profile") --- # Update – Webshare API Docs [User Profile](https://apidocs.webshare.io/userprofile) Update user profile Update user profile[](https://apidocs.webshare.io/userprofile/update#update-user-profile) ------------------------------------------------------------------------------------------ This endpoint updates the user profile. PATCH https://proxy.webshare.io/api/v2/profile/ ### Request & Response[](https://apidocs.webshare.io/userprofile/update#request--response) PythonJavascriptcURL patch\_profile.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/profile/", headers={"Authorization": "Token APIKEY"}, json={ "timezone":"America/New_York" }, ) response.json() The commands above return JSON structured like this: response.json { "id": 2, "email": "new@webshare.io", "is_email_verified": true, "first_name": "Jon", "last_name": "Denver", "last_login": "2023-03-04T05:34:35.553059-08:00", "timezone": "America/New_York" ... } [Retrieve user profile](https://apidocs.webshare.io/userprofile/retrieve "Retrieve user profile") [Retrive user preferences](https://apidocs.webshare.io/userprofile/retrivePreferences "Retrive user preferences") --- # Retrivepreferences – Webshare API Docs [User Profile](https://apidocs.webshare.io/userprofile) Retrive user preferences Retrieve user preferences[](https://apidocs.webshare.io/userprofile/retrivePreferences#retrieve-user-preferences) ------------------------------------------------------------------------------------------------------------------ This endpoint retrieves the user preferences. ### Request & Response[](https://apidocs.webshare.io/userprofile/retrivePreferences#request--response) GET https://proxy.webshare.io/api/v2/profile/preferences/ PythonJavascriptcURL get\_profile\_preferences.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/profile/preferences/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json // Example Response { "id": 1, "customer_satisfaction_survey_last_dismissed_at": "2022-06-14T15:59:06.663774-07:00", "customer_satisfaction_survey_last_completed_at": "2022-06-14T15:59:06.663774-07:00", "onboarding_activity_page_viewed_at": "2022-06-14T15:59:06.663774-07:00", ... } [Update user profile](https://apidocs.webshare.io/userprofile/update "Update user profile") [Update user preferences](https://apidocs.webshare.io/userprofile/updatePreferences "Update user preferences") --- # Updatepreferences – Webshare API Docs [User Profile](https://apidocs.webshare.io/userprofile) Update user preferences Update user preferences[](https://apidocs.webshare.io/userprofile/updatePreferences#update-user-preferences) ------------------------------------------------------------------------------------------------------------- This endpoint updates the user preferences. ### Request & Response fields[](https://apidocs.webshare.io/userprofile/updatePreferences#request--response-fields) This API can be called with one or more parameters according to which parameters are intented to be updated. | Parameter | Type | Description | | --- | --- | --- | | `customer_satisfaction_survey_last_dismissed_at` | `string` | The timestamp when the customer satisfication survey dissmissed. | | `customer_satisfaction_survey_last_completed_at` | `string` | The timestamp when the customer satisfication survey completed. | | `onboarding_activity_page_viewed_at` | `string` | The timestamp when the onboarding activity page viewed. | ### Request & Response[](https://apidocs.webshare.io/userprofile/updatePreferences#request--response) PATCH https://proxy.webshare.io/api/v2/profile/preferences/ PythonJavascriptcURL patch\_profile\_preferences.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/profile/preferences/", headers={"Authorization": "Token APIKEY"}, json={ "customer_satisfaction_survey_last_dismissed_at": "2022-06-14T15:59:06.663774-07:00" }, ) response.json() The commands above return JSON structured like this: response.json { "id": 2, "customer_satisfaction_survey_last_dismissed_at": "2022-06-14T15:59:06.663774-07:00", "customer_satisfaction_survey_last_completed_at": "2022-06-14T15:59:06.663774-07:00", "onboarding_activity_page_viewed_at": "2022-06-14T15:59:06.663774-07:00", ... } [Retrive user preferences](https://apidocs.webshare.io/userprofile/retrivePreferences "Retrive user preferences") [Notifications](https://apidocs.webshare.io/notifications "Notifications") --- # Notifications – Webshare API Docs Notifications Notifications ============= Account related activity is presented as notifications from the API. The notifications are similar to activity feed that a user can consume and dismiss as needed. ### The notification object[](https://apidocs.webshare.io/notifications#the-notification-object) Each notification instance has the following fields | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | The unique ID of the notification object. | | `type` | `string` | The type of notification. More details on each type can be found below. | | `is_dismissable` | `boolean` | Whether this notification dismissable by the end-user. | | `context` | `json` | Additional context for this notification. More information can be found below. | | `created_at` | `string` | The timestamp when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | | `dismissed_at` | `string` | The timestamp of when this notification was dismissed. May be `null`. | ### In JSON format[](https://apidocs.webshare.io/notifications#in-json-format) { "id": 13, "type": "too_much_bandwidth_too_little_proxies", "is_dismissable": true, "context": { "plan": 22 }, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "dismissed_at": null } ### Current supported notification types[](https://apidocs.webshare.io/notifications#current-supported-notification-types) #### The `too_much_bandwidth_too_little_proxies` type[](https://apidocs.webshare.io/notifications#the-too_much_bandwidth_too_little_proxies-type) This notification is triggered when a user has too much bandwidth and too little proxies. This notification type includes a context with one parameter `plan` which contains the related plan id. #### The `unlimited_bandwidth_gets_throttled` type[](https://apidocs.webshare.io/notifications#the-unlimited_bandwidth_gets_throttled-type) This notification is triggered due to high data usage on an Unlimited Bandwidth plan. This notification type includes a context with one parameter `plan` which contains the related plan id. #### The `subscription_renew_failed` type[](https://apidocs.webshare.io/notifications#the-subscription_renew_failed-type) This notification is triggered when a user failed to renew his subscription. This notification type includes a context with one parameter `effect` which can take three values: * `null`: For the first renew failed operation, with no further effect. * `proxies_stopped_working`: In the second faluire, the proxies will be stopped working. * `converted_to_free_plan`: In the third faluire, the subscription will be converted to free plan. #### The `subscription_cc_will_expire_soon` type[](https://apidocs.webshare.io/notifications#the-subscription_cc_will_expire_soon-type) This notification is triggered when a user's credit card will get expired soon. #### The `reminder_to_use_proxy` type[](https://apidocs.webshare.io/notifications#the-reminder_to_use_proxy-type) This notification is triggered to remind the users to use their proxies if they didn't start to use them yet. #### The `projected_proxy_usage_over_80` type[](https://apidocs.webshare.io/notifications#the-projected_proxy_usage_over_80-type) This notification is triggered when a user reached 80 percent of projected bandwidth usage. This notification type includes two parameters in the context: * `plan`: contains the related plan id. * `plan_limit`: the plan's bandwidth limit. #### The `projected_proxy_usage_over_100` type[](https://apidocs.webshare.io/notifications#the-projected_proxy_usage_over_100-type) This notification is triggered when a user reached 100 percent of projected bandwidth usage. This notification type includes two parameters in the context: * `plan`: contains the related plan id. * `plan_limit`: the plan's bandwidth limit. #### The `high_concurrency_error` type[](https://apidocs.webshare.io/notifications#the-high_concurrency_error-type) This notification is triggered when a user subscription gets high concurrency errors. This notification type includes three parameters: * `plan`: contains the related plan id. * `projected_bandwidth_gbs`: the current projected bandwidth usage rate. * `plan_limit`: the subscription's plan bandwidth limit. #### The `100_percent_bandwidth_used` type[](https://apidocs.webshare.io/notifications#the-100_percent_bandwidth_used-type) This notification is triggered when a user subscription reached %100 of bandwidth usage. This notification type includes a context with one parameter `plan` which contains the related `plan` id. #### The `proxies_are_unallocated` type[](https://apidocs.webshare.io/notifications#the-proxies_are_unallocated-type) This notification is triggered when some proxies from the proxy list are unallocated. This notification type includes a context with one parameter `plan` which contains the related plan id. #### The `question_is_added` type[](https://apidocs.webshare.io/notifications#the-question_is_added-type) The user needs to answer account verification question. This notification type does not include a context. [Update user preferences](https://apidocs.webshare.io/userprofile/updatePreferences "Update user preferences") [List notifications](https://apidocs.webshare.io/notifications/list "List notifications") --- # List Notifications – Webshare API Docs [Notifications](https://apidocs.webshare.io/notifications) List notifications List Notifications ================== This endpoint returns the notifications in [paginated](https://apidocs.webshare.io/#pagination) format. ### Parameters[](https://apidocs.webshare.io/notifications/list#parameters) | Parameter | Type | Description | | --- | --- | --- | | `dismissed_at__isnull` | `boolean` | Set to `True` to show only notifications that have not been dismissed (dismissed\_at is null). Set to `False` to show only dismissed notifications. | | `ordering` | `string` | Default ordering is `-created_at`. Available ordering fields are `id`, `created_at`, `dismissed_at`. | | `type` | `string` | Filter by type. | ### Request & Response[](https://apidocs.webshare.io/notifications/list#request--response) GET https://proxy.webshare.io/api/v2/notification/ PythonJavascriptcURL list\_notifications.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/notification/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 13,\ "type": "too_much_bandwidth_too_little_proxies",\ "is_dismissable": true,\ "context": { "plan": 22 },\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "dismissed_at": null\ },\ ...\ ] } [Notifications](https://apidocs.webshare.io/notifications "Notifications") [Retrieve a notification](https://apidocs.webshare.io/notifications/retrieve "Retrieve a notification") --- # Get notification – Webshare API Docs [Notifications](https://apidocs.webshare.io/notifications) Retrieve a notification Get notification ================ This endpoint lets you retrieve a notification. ### Parameters[](https://apidocs.webshare.io/notifications/retrieve#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the notification to retrieve. | ### Request & Response[](https://apidocs.webshare.io/notifications/retrieve#request--response) GET https://proxy.webshare.io/api/v2/notification// PythonJavascriptcURL get\_notification.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/notification//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 13, "type": "too_much_bandwidth_too_little_proxies", "is_dismissable": true, "context": { "plan": 22 }, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "dismissed_at": null } [List notifications](https://apidocs.webshare.io/notifications/list "List notifications") [Dismiss a notification](https://apidocs.webshare.io/notifications/dismiss "Dismiss a notification") --- # Dismiss notification – Webshare API Docs [Notifications](https://apidocs.webshare.io/notifications) Dismiss a notification Dismiss notification ==================== This endpoint lets you dismiss a notification. ### Parameters[](https://apidocs.webshare.io/notifications/dismiss#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the notification to dismiss. | ### Request & Response[](https://apidocs.webshare.io/notifications/dismiss#request--response) POST https://proxy.webshare.io/api/v2/notification//dismiss/ PythonJavascriptcURL dismiss\_notification.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/notification//dismiss/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 13, "type": "too_much_bandwidth_too_little_proxies", "is_dismissable": true, "context": { "plan": 22 }, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "dismissed_at": "2022-06-14T11:58:10.246406-07:00" } [Retrieve a notification](https://apidocs.webshare.io/notifications/retrieve "Retrieve a notification") [Restore a notification](https://apidocs.webshare.io/notifications/restore "Restore a notification") --- # Restore notification – Webshare API Docs [Notifications](https://apidocs.webshare.io/notifications) Restore a notification Restore notification ==================== This endpoint lets you restore a notification. ### Parameters[](https://apidocs.webshare.io/notifications/restore#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the notification to restore. | ### Request & Response[](https://apidocs.webshare.io/notifications/restore#request--response) POST https://proxy.webshare.io/api/v2/notification//restore/ PythonJavascriptcURL restore\_notification.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/notification//restore/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 13, "type": "too_much_bandwidth_too_little_proxies", "is_dismissable": true, "context": { "plan": 22 }, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "dismissed_at": null } [Dismiss a notification](https://apidocs.webshare.io/notifications/dismiss "Dismiss a notification") [Proxy List](https://apidocs.webshare.io/proxy-list "Proxy List") --- # Proxy List API – Webshare API Docs Proxy List Proxy List API ============== You can use the Webshare API to retrieve your proxy list in 2 modes: `direct` and `backbone`. Each mode returns the same proxy data structure with minor changes on how the fields are used. See [Proxy Connection](https://apidocs.webshare.io/proxy-connection) for connection details, username parameters, and geo targeting options. Backbone Proxy[](https://apidocs.webshare.io/proxy-list#backbone-proxy) ------------------------------------------------------------------------ Backbone proxy connections always use `p.webshare.io` connection address. In username/password authentication, the following ports can be used: `80`, `1080`, `3128` and `9999 - 19999`. The IP Authentication mode, you must use the `port` field returned from the API. Direct Proxy[](https://apidocs.webshare.io/proxy-list#direct-proxy) -------------------------------------------------------------------- Direct proxy connections use the `proxy_address` and `port` fields returned from the API. For username/password authentication, provide the `username` and `password` credentials. For IP Authorization, no credentials are needed. See [Proxy Connection](https://apidocs.webshare.io/proxy-connection) for curl examples and more details. The Proxy object[](https://apidocs.webshare.io/proxy-list#the-proxy-object) ---------------------------------------------------------------------------- | Attributes | Type | Description | | --- | --- | --- | | `id` | `string` | Unique identifier of the proxy instance. | | `username` | `string` | Proxy username. | | `password` | `string` | Proxy password. | | `proxy_address` | `string` | IP Address of the proxy. In Direct Connection mode, connect to this IP address. In Backbone Connection mode, connect to `p.webshare.io`. This field is `null if` plan.pool\_filter`is`residential\`. | | `port` | `int` | Port used to connect to the proxies. In Backbone mode, the port is always set for IP Authorization. | | `valid` | `boolean` | If the proxy is working as expected. Webshare checks proxies once every 30 seconds. | | `last_verification` | `string` | Last time the proxy was checked. | | `country_code` | `string` | The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
of the proxy. | | `city_name` | `string` | The city name of the proxy. | | `created_at` | `string` | The timestamp of when this instance was created. | proxy\_object.json { "id": "d-10513", "username": "username", "password": "password", "proxy_address": "1.2.3.4", "port": 8168, "valid": true, "last_verification": "2019-06-09T23:34:00.095501-07:00", "country_code": "US", "city_name": "New York", "created_at": "2022-06-14T11:58:10.246406-07:00" } [Restore a notification](https://apidocs.webshare.io/notifications/restore "Restore a notification") [List proxies](https://apidocs.webshare.io/proxy-list/list "List proxies") --- # List proxies – Webshare API Docs [Proxy List](https://apidocs.webshare.io/proxy-list) List proxies List proxies ============ This endpoint returns the proxy list in [paginated](https://apidocs.webshare.io/#pagination) format. The `mode` parameter must always be specified. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/proxy-list/list#parameters) | Parameter | Type | Description | | --- | --- | --- | | `mode` | `string` | Must be either `direct` or `backbone`. Required field. This field must be `backbone` if `plan.pool_filter` is `residential`. | | `country_code__in` | `string` | Filter by comma separated [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
. Example filtering USA and French proxies: `FR,US`. Optional field. | | `search` | `string` | Filter by a search phrase. Can accept arbitrary text. Search does not work in `backbone` mode. Optional field. | | `ordering` | `string` | Comma separated list of fields to specify ordering. Reverse ordering (DESC) can be achieved by adding minus in front of the field. Example: `-valid,proxy_address`. Ordering is not supported in the `backbone` mode. Optional field. | | `created_at` | `string` | Filter by proxy create date. created\_at filter does not work in `backbone` mode. Optional field. | | `proxy_address` | `string` | Filter by a specific proxy address. proxy\_address filter does not work in `backbone` mode. Optional field. | | `proxy_address__in` | `string` | Filter by comma separated proxy addresses. proxy\_address\_\_in filter does not work in `backbone` mode. Optional field. | | `valid` | `boolean` | Filter by the validity of the proxy address. valid filter does not work in `backbone` mode. Optional field. | | `asn_number` | `string` | Filter by the the proxy address ASN number. asn\_number filter does not work in `backbone` mode. Optional field. | | `asn_name` | `string` | Filter by the the proxy address ASN name. asn\_name filter does not work in `backbone` mode. Optional field. | ### Request & Response[](https://apidocs.webshare.io/proxy-list/list#request--response) PythonJavascriptcURL list\_proxies.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/list/?mode=direct&page=1&page_size=25", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 10, "next": null, "previous": null, "results": [\ {\ "id": "d-10513",\ "username": "username",\ "password": "password",\ "proxy_address": "1.2.3.4",\ "port": 8168,\ "valid": true,\ "last_verification": "2019-06-09T23:34:00.095501-07:00",\ "country_code": "US",\ "city_name": "New York",\ "created_at": "2022-06-14T11:58:10.246406-07:00"\ },\ ...\ ] } [Proxy List](https://apidocs.webshare.io/proxy-list "Proxy List") [Download proxy list](https://apidocs.webshare.io/proxy-list/download "Download proxy list") --- # Download proxy list – Webshare API Docs [Proxy List](https://apidocs.webshare.io/proxy-list) Download proxy list Download proxy list =================== This API does not require authentication. You can download the proxy list as a file using the links below. These links use `proxy_list_download_token` which can be retrieved from the [Proxy Config](https://apidocs.webshare.io/proxy-config) API. This is the same underlying token as the one returned by the [Get Download Token](https://apidocs.webshare.io/downloads/get_download_token) API with the `proxy_list` scope — you can retrieve it via either API and rotate it via the [Reset Download Token](https://apidocs.webshare.io/downloads/reset_download_token) API. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. Download proxy list endpoint GET https://proxy.webshare.io/api/v2/proxy/list/download/ {token}/{country_codes}/any/{authentication_method}/{endpoint_mode}/{search}/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/proxy/list/download/ {token}/{country_codes}/any/{authentication_method}/{endpoint_mode}/{search}/?plan_id= ### Parameters[](https://apidocs.webshare.io/proxy-list/download#parameters) | Key | Type | Description | | --- | --- | --- | | `token` | `string` | Token retrieved from the [Proxy Config](https://apidocs.webshare.io/proxy-config)
API. | | `country_codes` | `string` | [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
separated by hyphen (`-`). In order to select all countries, use `-` | | `authentication_method` | `string` | `username` or `sourceip`. Determines the authentication method to access to the proxies. | | `endpoint_mode` | `string` | `backbone` or `direct`. Determines the proxy format. Must be set to `backbone` if `plan.pool_filter` is `residential`. | | `search` | `string` | URL encoded search terms. Can be set as `-` to indicate no search terms. | ### Request & Response[](https://apidocs.webshare.io/proxy-list/download#request--response) PythonJavascriptcURL download\_list.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/list/download/{TOKEN}/-/any/username/direct/san%20francisco/" ) response.text The commands above return plain text file in the following format: response 10.1.2.3:9421:username:password 10.1.2.4:6511:username:password [List proxies](https://apidocs.webshare.io/proxy-list/list "List proxies") [Refresh proxy list](https://apidocs.webshare.io/proxy-list/ondemand_refresh "Refresh proxy list") --- # Refresh proxy list – Webshare API Docs [Proxy List](https://apidocs.webshare.io/proxy-list) Refresh proxy list Refresh proxy list ================== Refresh your entire proxy list. You can only perform this action if you have `on_demand_refreshes_available` available. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. POST https://proxy.webshare.io/api/v2/proxy/list/refresh/ or in case of targeting a specific plan POST https://proxy.webshare.io/api/v2/proxy/list/refresh/?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-list/ondemand_refresh#request--response) PythonJavascriptcURL refresh\_list.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/proxy/list/refresh/", headers={"Authorization": "Token APIKEY"} ) response.json() The above command returns empty response with `204 No Content` HTTP/1.1 204 No Content [Download proxy list](https://apidocs.webshare.io/proxy-list/download "Download proxy list") [Proxy Connection](https://apidocs.webshare.io/proxy-connection "Proxy Connection") --- # Proxy Connection – Webshare API Docs Proxy Connection Proxy Connection ================ Webshare proxies support two connection modes: **Backbone** and **Direct**. This page covers the connection details and parameters available for each mode. Backbone Connection[](https://apidocs.webshare.io/proxy-connection#backbone-connection) ---------------------------------------------------------------------------------------- Backbone proxy connections always use `p.webshare.io` as the connection address. * **Username/password authentication:** ports `80`, `1080`, `3128`, and `9999 - 19999` * **IP Authorization:** use the `port` field returned from the API ### Username Parameters[](https://apidocs.webshare.io/proxy-connection#username-parameters) When using username/password authentication, you can append parameters to your proxy username using hyphens (`-`) to control country targeting, session management, and geo targeting. **Format:** `{username}-{country_code}-{geo_params}-{session_id}` | Parameter | Format | Description | | --- | --- | --- | | `Country code` | `` `{username}-us` `` | Append a 2-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
to target a specific country. Multiple codes can be chained (e.g. `-us-fr-de`). | | `Session ID` | `` `{username}-us-1234` `` | Append a numeric session ID to maintain a sticky session. The same session ID will route to the same exit IP for the duration of the session. | | `Rotate` | `` `{username}-us-rotate` `` | Append `rotate` to get a new IP on every request. Cannot be combined with a session ID. | | `City` | `` `{username}-us-city_los_angeles` `` | Target a specific city. Works with any country. The value must contain only letters and underscores. | The city geo targeting parameter is only available for **residential** proxy plans. **Examples:** # US, sticky session 1234 curl --proxy "http://myuser-us-1234:password@p.webshare.io:80/" https://ipv4.webshare.io/ # US, Los Angeles, rotating IP curl --proxy "http://myuser-us-city_los_angeles-rotate:password@p.webshare.io:80/" https://ipv4.webshare.io/ # Germany, Munich, sticky session 1234 curl --proxy "http://myuser-de-city_munich-1234:password@p.webshare.io:80/" https://ipv4.webshare.io/ Direct Connection[](https://apidocs.webshare.io/proxy-connection#direct-connection) ------------------------------------------------------------------------------------ Direct proxy connections use the `proxy_address` and `port` fields returned from the [Proxy List API](https://apidocs.webshare.io/proxy-list) . * **Username/password authentication:** provide `username` and `password` along with the proxy address and port. * **IP Authorization:** only the proxy address and port are needed (no credentials). Your source IP must be authorized via the [IP Authorization API](https://apidocs.webshare.io/ipauthorization) . **Examples:** # Username/password authentication curl --proxy "http://username:password@1.2.3.4:8168/" https://ipv4.webshare.io/ # IP Authorization (no credentials needed) curl --proxy "http://1.2.3.4:8168/" https://ipv4.webshare.io/ [Refresh proxy list](https://apidocs.webshare.io/proxy-list/ondemand_refresh "Refresh proxy list") [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement "Proxy Replacement") --- # Proxy Replacement – Webshare API Docs Proxy Replacement Proxy Replacement ================= You can replace and list the replaced proxies using the Proxy Replacement API. There are 2 main endpoints for replacing proxies. ### Proxy replacement[](https://apidocs.webshare.io/proxy-replacement#proxy-replacement) Set of rules indicating which proxies to replace from and replace with in a proxy list. [See Proxy Replacement Object](https://apidocs.webshare.io/proxy-replacement/proxy_replacement) . ### Replaced proxy[](https://apidocs.webshare.io/proxy-replacement#replaced-proxy) List of replaced proxies which can be filtered by proxy replacement or the proxy list. [See Replaced Proxy Object](https://apidocs.webshare.io/proxy-replacement/replaced_proxy) . [Proxy Connection](https://apidocs.webshare.io/proxy-connection "Proxy Connection") [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement "Proxy Replacement") --- # List proxy replacement – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement) List replacement List proxy replacement ====================== This endpoint retrieves all existing proxy replacements associated with the user in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_list#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ordering` | `string` | Default ordering is `id`. Available ordering fields are `id`, `created_at`, `completed_at`. | | `dry_run` | `boolean` | Filter proxy replacements with whether it is dry run or not. | | `state` | `string` | Filter proxy replacements by state | ### Request & Response[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_list#request--response) GET https://proxy.webshare.io/api/v3/proxy/replace/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v3/proxy/replace/?plan_id= PythonJavascriptcURL list\_proxy\_replacement.py import requests response = requests.get( "https://proxy.webshare.io/api/v3/proxy/replace/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 98315,\ "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]},\ "replace_with": [{"type": "country", "country_code": "US"}],\ "dry_run": false,\ "state": "completed",\ "proxies_removed": 1,\ "proxies_added": 1,\ "reason": "proxy_replaced",\ "error": null,\ "error_code": null,\ "created_at": "2022-07-26T21:25:13.966946-07:00",\ "dry_run_completed_at": "2022-07-26T21:25:13.966946-07:00",\ "completed_at": "2022-07-26T22:25:13.966946-07:00"\ },\ ...\ ] } [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement "Proxy Replacement") [Get replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve "Get replacement") --- # The replaced proxy – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) Replaced Proxy The replaced proxy ================== List of replaced proxies which can be filtered by proxy replacement or the proxy list. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Replaced proxy object[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy#replaced-proxy-object) | Parameter | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identified of the replaced proxy instance. | | `reason` | `string` | The reason this proxy was replaced. You can view all reasons in the table below. | | `proxy` | `string` | The IP address of the replaced proxy. | | `proxy_port` | `integer` | The port of the replaced proxy. | | `proxy_country_code` | `string` | Country code in [ISO-3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
format. | | `replaced_with` | `string` | The IP address of the new proxy. | | `replaced_with_port` | `integer` | The port of the new proxy. | | `replaced_with_country_code` | `string` | Country code in [ISO-3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
format. | | `created_at` | `string` | The timestamp of when this instance was created. | ### Replacement reasons[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy#replacement-reasons) | Reason | Type | Description | | --- | --- | --- | | `list_updated` | `string` | Proxy was removed/added due to change of subscription. | | `proxy_replaced` | `string` | Proxy was replaced manually by the user. | | `auto_invalidated` | `string` | Proxy was auto-replaced due to failing status checks for over 15 minutes. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_out_of_rotation` | `string` | Proxy was auto-replaced due to moving out of rotation by Webshare admins. This usually indicates that the proxy is not performing at 100%. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_low_country_confidence` | `string` | Proxy was auto-replaced due to country code change. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_deleted` | `string` | The proxy was deleted from the system. This is an automated action and cannot be turned off. | | `auto_site_check` | `string` | The proxy does not pass the site checks any longer. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | ### In JSON format[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy#in-json-format) replaced\_proxy\_object\_schema.json { "id": 93892, "reason": "proxy_replaced", "proxy": "45.158.184.116", "proxy_port": 9192, "proxy_country_code": "US", "replaced_with": "104.227.101.59", "replaced_with_port": 6120, "replaced_with_country_code": "US", "created_at": "2022-07-26T21:25:13.966946-07:00" } [Create replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create "Create replacement") [List replaced proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/list_replaced_proxy "List replaced proxy") --- # Download replaced proxy list – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) [Replaced Proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy) Download replaced proxy list Download replaced proxy list ============================ This API does not require authentication. You can download the replaced proxy list as a file using the link below. This link use a token which can be retrieved from the [Get Download Token](https://apidocs.webshare.io/downloads/get_download_token) API with the scope "replaced\_proxy". Download replaced proxy list endpoint GET https://proxy.webshare.io/api/v2/proxy/list/replaced/download/ ### Parameters[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/download#parameters) | Key | Type | Description | | --- | --- | --- | | `download_token` | `string` | Token retrieved from the [Get Download Token](https://apidocs.webshare.io/downloads/get_download_token)
API with the scope 'replaced\_proxy' | | `country_codes` | `string` | [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
separated by hyphen (`-`). In order to select all countries, use `-` | | `authentication_type` | `string` | `username` or `sourceip`. Determines the authentication method to access to the proxies. | | `mode` | `string` | `backbone` or `direct`. Determines the proxy format. Must be set to `backbone` if `plan.pool_filter` is `residential`. | | `search` | `string` | URL encoded search terms. Can be set as `-` to indicate no search terms. | | `proxy_protocol` | `string` | The proxy protocol of the proxies to download. Can be set to `any`. | | `proxy_list_replacement` | `int` | Query string parameter that filter the replaced proxies by a specific Proxy replacement. | ### Request & Response[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/download#request--response) PythonJavascriptcURL download\_replaced\_list.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/list/replaced/download/", { "download_token": DOWNLOAD_TOKEN, "search": "san francisco", "country_codes": "-", "proxy_protocol": "any", "authentication_type": "username", "mode": "direct" } ) response.text The commands above return plain text file in the following format where the values in order are, the new proxy address, the new port, the username, the password and then the replaced proxy address: response 10.1.2.3:9421:username:password:10.1.2.7 10.1.2.4:6511:username:password:10.1.2.8 [List replaced proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/list_replaced_proxy "List replaced proxy") [Proxy Configuration](https://apidocs.webshare.io/proxy-config "Proxy Configuration") --- # Get proxy replacement – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement) Get replacement Get proxy replacement ===================== This endpoint lets you get an existing proxy replacement. You can use this endpoint when you create a proxy replacement request to keep checking the status of that request. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve#parameters) GET https://proxy.webshare.io/api/v3/proxy/replace/{ID}/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v3/proxy/replace/{ID}/?plan_id= | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the proxy replacement to retrieve. | ### Request & Response[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve#request--response) PythoncURL get\_proxy\_replacement.py import requests response = requests.get( "https://proxy.webshare.io/api/v3/proxy/replace//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 98315, "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "country", "country_code": "US"}], "dry_run": false, "state": "completed", "proxies_removed": 1, "proxies_added": 1, "reason": "proxy_replaced", "error": null, "error_code": null, "created_at": "2022-07-26T21:25:13.966946-07:00", "dry_run_completed_at": "2022-07-26T21:25:13.966946-07:00", "completed_at": "2022-07-26T22:25:13.966946-07:00" } ### States[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve#states) | State | Description | | --- | --- | --- | | `validating` | `Dry run proxy replacement request is still in progress.` | | | `validated` | `Dry run proxy replacement request is finished.` | | | `processing` | `Actual proxy replacement request is still in progress.` | | | `completed` | `Actual proxy replacement request is finished.` | | | `failed` | `In case of failure, you will get error_code and an error message.` | | ### Error Types[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve#error-types) | Error Code | Error | | --- | --- | --- | | `proxies_removed_doesnt_match_added` | `No new proxies available. Please try replacing your proxies again later.` | | | `not_enough_replacements_in_subscription` | `You have 1 proxy replacements remaining. Upgrade subscription to receive more replacements.` | | | `no_proxies_to_be_replaced` | `No proxies to be replaced. Please pick the proxies you want to replace.` | | [List replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_list "List replacement") [Create replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create "Create replacement") --- # IP Authorization – Webshare API Docs IP Authorization IP Authorization ================ Webshare proxy offers 2 methods for authenticating with the proxies: password and IP Authorization. If you do not wish to use password authentication, you can instead authorize your IP address using this API. ### The IP authorization object[](https://apidocs.webshare.io/ipauthorization#the-ip-authorization-object) Each IP Authorization instance has the following fields | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | The unique ID of the IP Authorization object. | | `ip_address` | `string` | The IP address which is authorized to connect to the proxies without username/password. | | `created_at` | `string` | The timestamp of when this instance was created. | | `last_used_at` | `string` | The timestamp when this IP address was last used. | ### In JSON format[](https://apidocs.webshare.io/ipauthorization#in-json-format) { "id": 1337, "ip_address": "10.1.2.3", "created_at": "2022-06-14T11:58:10.246406-07:00", "last_used_at": null } [Assign unallocated countries](https://apidocs.webshare.io/proxy-config/allocate_unallocated_countries "Assign unallocated countries") [Create IP authorization](https://apidocs.webshare.io/ipauthorization/create "Create IP authorization") --- # List Replaced Proxy – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) [Replaced Proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy) List replaced proxy List replaced proxies[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/list_replaced_proxy#list-replaced-proxies) -------------------------------------------------------------------------------------------------------------------------------- This endpoint returns the replaced proxy list in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. GET https://proxy.webshare.io/api/v2/proxy/list/replaced/ ### URL Parameters[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/list_replaced_proxy#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `proxy_list_replacement` | `int` | Filter the replaced proxies by a specific Proxy replacement. | ### Request & Response[](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/list_replaced_proxy#request--response) PythonJavascriptcURL list\_replaced\_proxies.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/list/replaced/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 10, "next": null, "previous": null, "results": [\ {\ "id": 93892,\ "reason": "proxy_replaced",\ "proxy": "45.158.184.116",\ "proxy_port": 9192,\ "proxy_country_code": "US",\ "replaced_with": "104.227.101.59",\ "replaced_with_port": 6120,\ "replaced_with_country_code": "US",\ "created_at": "2022-07-26T21:25:13.966946-07:00"\ },\ ...\ ] } [Replaced Proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy "Replaced Proxy") [Download replaced proxy list](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/download "Download replaced proxy list") --- # The proxy replacement object – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) Proxy Replacement ### Proxy replacement[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#proxy-replacement) Set of rules indicating which proxies to replace from and replace with in a proxy list. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. The proxy replacement object ============================ ### Parameters[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#parameters) | Attributes | Type | Description | | --- | --- | --- | | `id` | `number` | Unique identified of the proxy replacement instance. | | `to_replace` | `dictionary` | Dictionary indicating which proxies to replace. Complete field definition can be found below. | | `replace_with` | `list of dictionaries` | List of dictionaries indicating which proxies to replace with. Complete field definition can be found below. Availability can be retrieved using [Proxy Configuration](https://apidocs.webshare.io/proxy-config) | | `dry_run` | `boolean` | You can dry-run a replacement to learn number of proxies removed/added prior to actually replacing the proxy list. `dry_run=True` does not modify the proxy list. | | `state` | `string` | The current state of the proxy replacement can be: `validating`, `validated`, `processing`, `completed` and `failed`. If failed, error\_code and error will have values to describe the error. | | `proxies_removed` | `number` | Number of proxies removed from the proxy list. | | `proxies_added` | `number` | Number of proxies added to the proxy list. | | `reason` | `string` | The reason proxies were replaced. You can view all reasons in the table below. Manually creating a replacement sets the reason as `proxy_replaced`. | | `error_code` | `string` | The error code. | | `error` | `string` | The error message. | | `created_at` | `string` | The timestamp of when this instance was created. | | `dry_run_completed_at` | `string` | The timestamp of when this instance state became `validated`. May be `null`. | | `completed_at` | `string` | The timestamp of when this instance state became `completed`. May be `null`. | ### Replacement reasons[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#replacement-reasons) | Reason | Type | Description | | --- | --- | --- | | `list_updated` | `string` | Proxy was removed/added due to change of subscription. | | `proxy_replaced` | `string` | Proxy was replaced manually by the user. | | `auto_invalidated` | `string` | Proxy was auto-replaced due to failing status checks for over 15 minutes. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_out_of_rotation` | `string` | Proxy was auto-replaced due to moving out of rotation by Webshare admins. This usually indicates that the proxy is not performing at 100%. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_low_country_confidence` | `string` | Proxy was auto-replaced due to country code change. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | | `auto_deleted` | `string` | The proxy was deleted from the system. This is an automated action and cannot be turned off. | | `auto_site_check` | `string` | The proxy does not pass the site checks any longer. This automated action can be turned off via the [Proxy Config API](https://apidocs.webshare.io/proxy-config)
. | ### In JSON Format[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#in-json-format) replacement\_object.json { "id": 98315, "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "country", "country_code": "US"}], "dry_run": false, "state": "completed", "proxies_removed": 1, "proxies_added": 1, "reason": "proxy_replaced", "error": null, "error_code": null, "created_at": "2022-07-26T21:25:13.966946-07:00", "dry_run_completed_at": "2022-07-26T21:25:13.966946-07:00", "completed_at": "2022-07-26T22:25:13.966946-07:00" } Replacement Definitions[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#replacement-definitions) ------------------------------------------------------------------------------------------------------------------- There are 3 types of value for `to_replace` | `replace_with` fields. a `replace_with` may be a list of dictionaries/types as we may not have enough replacements from one country. For example, if we want to replace 10 US proxies with 5 French and 5 Turkish, you can use the fields as follows: ## To Replace to_replace: { type: "country", country_code: "US", count: 10 } ## Replace with replace_with: [\ { type: "country", country_code: "FR", count: 5 },\ { type: "country", country_code: "TR", count: 5 }\ ] ### Type: IP range[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#type-ip-range) type=ip_range | Attributes | Type | Description | | --- | --- | --- | | `type` | `string` | Set to `ip_range`. Indicates which proxy IP addresses to replace or replace with. | | `ip_ranges` | `list` | List of IP ranges in [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
, e.g. 10.0.0.0/8. Host bits may not be set. For example, 10.0.0.1/24 is invalid. However, 10.0.0.0/24 is valid. | | `count` | `number` | Number of proxies to replace with. | ### Type: IP address[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#type-ip-address) type=ip_address | Attributes | Type | Description | | --- | --- | --- | | `type` | `string` | Set to `ip_address`. Indicates which proxy IP addresses to replace. Cannot be used with `replace_with` field. | | `ip_addresses` | `list` | List of IP addresses (without the CIDR notation). For example \['1.0.0.1', '1.0.0.2'\]. | | `count` | `number` | Number of proxies to replace. | ### Type: ASN[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#type-asn) type=asn | Attributes | Type | Description | | --- | --- | --- | | `type` | `string` | Set to `asn`. Indicates which proxy ASN number to replace. | | `asn_numbers` | `list` | List of ASN numbers as strings. For example \['7631', '11964'\]. Integers are also accepted. | | `count` | `number` | Number of proxies to replace. | ### Type: Country[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#type-country) type=country | Attributes | Type | Description | | --- | --- | --- | | `type` | `string` | Set to `country`. Indicates which proxy countries to replace or replace with. | | `country_code` | `string` | Country code in [ISO-3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
format. | | `count` | `number` | Number of proxies to replace with. | ### Type: Any[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement#type-any) type=any | Attributes | Type | Description | | --- | --- | --- | | `type` | `string` | Set to `any`. Only used in the `replace_with` field. | | `count` | `number` | Number of proxies to replace with. | [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement "Proxy Replacement") [List replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_list "List replacement") --- # Get proxy stats – Webshare API Docs [Proxy Configuration](https://apidocs.webshare.io/proxy-config) Get proxy stats Get proxy stats =============== This endpoint retrieves the proxy stats. You need to add a query-string parameter `plan_id`. GET https://proxy.webshare.io/api/v3/proxy/list/stats?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-config/get_proxy_stats#request--response) PythonJavascriptcURL get\_proxy\_stats.py import requests response = requests.get( "https://proxy.webshare.io/api/v3/proxy/list/stats?plan_id=PLAN-ID", headers={ "Authorization": "Token APIKEY" } ) response.json() The commands above return JSON structured like this: response.json { "available_countries": {"US": 95}, "ip_ranges_24": {"10.1.1.0/24": 5, "10.1.3.0/24": 100}, "ip_ranges_16": {"10.1.0.0/16": 105}, "ip_ranges_8": {"10.0.0.0/8": 105}, "available_ip_ranges_24": {"1.2.3.0/24": 100}, "available_ip_ranges_16": {"1.2.0.0/16": 100}, "available_ip_ranges_8": {"1.0.0.0/8": 100}, "asns": {"6137": ["ASN NAME", 105]}, "available_asns": {"9421": ["ASN NAME", 105]} } ### Response fields[](https://apidocs.webshare.io/proxy-config/get_proxy_stats#response-fields) Each field maps a key (country code, IP range, or ASN) to the number of proxies in that group. Fields prefixed with `available_` describe the proxy pool that the list can draw from, after excluding proxies already allocated to the list. Fields without the prefix describe the proxies currently allocated to the list. | Field | Type | Description | | --- | --- | --- | | `available_countries` | `object` | Proxies in the pool that match the list filters (country selection, sources, ASNs, site checks) and are not yet allocated to this list, grouped by country code. This is the supply available for future allocations and replacements, not the current contents of the list. | | `ip_ranges_24` | `object` | Proxies currently allocated to the list, grouped by /24 subnet. | | `ip_ranges_16` | `object` | The same allocated proxies, aggregated into /16 subnets. | | `ip_ranges_8` | `object` | The same allocated proxies, aggregated into /8 subnets. | | `available_ip_ranges_24` | `object` | Proxies eligible as replacements, grouped by /24 subnet. | | `available_ip_ranges_16` | `object` | Proxies eligible as replacements, grouped by /16 subnets. | | `available_ip_ranges_8` | `object` | Proxies eligible as replacements, grouped by /8 subnets. | | `asns` | `object` | Proxies currently allocated to the list, grouped by ASN. Each value is a tuple of ASN name and proxy count. | | `available_asns` | `object` | Pool proxies available to the list htat are not yet allocated to this list, grouped by ASN. Each value is a tuple of ASN name and proxy count. | [Proxy Configuration](https://apidocs.webshare.io/proxy-config "Proxy Configuration") [Get proxy status](https://apidocs.webshare.io/proxy-config/get_proxy_status "Get proxy status") --- # Proxy Configuration – Webshare API Docs Proxy Configuration Proxy Configuration =================== ### The proxy config object[](https://apidocs.webshare.io/proxy-config#the-proxy-config-object) You can use the API to retrieve information about your proxy configuration. | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the proxy configuration instance. | | `state` | `string` | Indicates whether a proxy list is ready to use or not. Values can be `pending`, `processing` or `completed`. | | `countries` | `object` | Proxy countries by count in the proxy list. Cannot be edited. | | `available_countries` | `object` | Proxy countries by count available (not in the current proxy list). This field is useful when listing which countries are available when replacing proxies. Cannot be edited. | | `unallocated_countries` | `object` | Unallocated proxy countries by count. A proxy becomes unallocated if the Plan object requested for a specific country but that country was not available to be allocated for the Proxy List. | | `ip_ranges_24` | `object` | IP ranges in /24 subnet by count in the proxy list. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `ip_ranges_16` | `object` | IP ranges in /16 subnet by count in the proxy list. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `ip_ranges_8` | `object` | IP ranges in /8 subnet by count in the proxy list. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `available_ip_ranges_24` | `object` | IP ranges in /24 subnet by count available (not in the current proxy list). This field is useful when listing which IP ranges are available when replacing proxies. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `available_ip_ranges_16` | `object` | IP ranges in /16 subnet by count available (not in the current proxy list). This field is useful when listing which IP ranges are available when replacing proxies. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `available_ip_ranges_8` | `object` | IP ranges in /8 subnet by count available (not in the current proxy list). This field is useful when listing which IP ranges are available when replacing proxies. Format is CIDR:count. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `asns` | `object` | List of ASNs in {asn\_number: (asn\_name, count)} format. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `available_asns` | `object` | List of ASNs in {asn\_number: (asn\_name, count)} format. Cannot be edited. This field is an empty dictionary if `plan.pool_filter` is `residential`. | | `username` | `string` | Proxy username. Must be between 8-32 characters, alphanumeric. | | `password` | `string` | Proxy password. Must be between 8-32 characters, alphanumeric. Cannot be too common password. Cannot be too similar to proxy username. | | `request_timeout` | `integer` | Maximum number of seconds a proxy request can be used. Min value is 15 seconds. Max value is 7 days. | | `request_idle_timeout` | `integer` | Maximum number of seconds a proxy request can stay idle (no data sent). Min value is 15 seconds. Max value is 2 hours. | | `ip_authorization_country_codes` | `object` | The list of country codes the proxy should serve for IP Authorization in Backbone Connection mode. If set to `null`, all countries are available. | | `ip_authorization_city` | `string` | City name for IP Authorization geo targeting (e.g. `los_angeles`). Only applies to residential plans. Set to `null` to disable. Must contain only letters and underscores. | | `ip_authorization_asn` | `string` | ASN to target for requests authenticated via IP Authorization in Backbone Connection mode (e.g. `7922` or `AS7922`). Must be a numeric ASN; the optional `AS`/`as` prefix is stripped before storage. Cannot be combined with `ip_authorization_country_codes`, and only one of `ip_authorization_asn`, `ip_authorization_state`, `ip_authorization_city`, or `ip_authorization_postalcode` may be set at a time. Set to `null` to disable. | | `auto_replace_invalid_proxies` | `boolean` | Auto-replace proxies from the proxy list if they are invalid for 15 minutes. Cannot be edited for free proxy plans. | | `auto_replace_low_country_confidence_proxies` | `boolean` | Auto-replace proxies from the proxy list if they have low country confidence. Cannot be edited for free proxy plans. | | `auto_replace_out_of_rotation_proxies` | `boolean` | Auto-replace proxies from the proxy list if they are performing slower than usual. | | `auto_replace_failed_site_check_proxies` | `boolean` | Auto-replace proxies if the proxy does not pass site-checks any longer. | | `proxy_list_download_token` | `string` | Alpha-numeric randomly generated token used for proxy list download links. | | `is_proxy_used` | `boolean` | Indicates whether a proxy has been used. | | `created_at` | `string` | The timestamp of when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | ### In JSON format[](https://apidocs.webshare.io/proxy-config#in-json-format) { "id": 1, "state": "completed", "countries": {"US": 5, "FR": 100}, "available_countries": {"US": 95}, "unallocated_countries": {}, "ip_ranges_24": {"10.1.1.0/24": 5, "10.1.3.0/24": 100}, "ip_ranges_16": {"10.1.0.0/16": 105}, "ip_ranges_8": {"10.0.0.0/8": 105}, "available_ip_ranges_24": {"1.2.3.0/24": 100}, "available_ip_ranges_16": {"1.2.0.0/16": 100}, "available_ip_ranges_8": {"1.0.0.0/8": 100}, "asns": {"6137": ["ASN NAME", 105]}, "available_asns": {"9421": ["ASN NAME", 105]}, "username": "username", "password": "password", "request_timeout": 86400, "request_idle_timeout": 900, "ip_authorization_country_codes": ["US", "FR"], "ip_authorization_city": "los_angeles", "ip_authorization_asn": null, "auto_replace_invalid_proxies": true, "auto_replace_low_country_confidence_proxies": false, "auto_replace_out_of_rotation_proxies": false, "auto_replace_failed_site_check_proxies": false, "proxy_list_download_token": "aa87abbc...zz", "is_proxy_used": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } ### IP Authorization Geo Targeting[](https://apidocs.webshare.io/proxy-config#ip-authorization-geo-targeting) The `ip_authorization_city` field allows you to configure a default city for requests authenticated via IP Authorization. This field is only available for **residential** proxy plans. `ip_authorization_city` works with any country. If multiple countries are configured in `ip_authorization_country_codes`, one country is randomly selected per request and the city (if set) is applied. ### IP Authorization ASN Targeting[](https://apidocs.webshare.io/proxy-config#ip-authorization-asn-targeting) The `ip_authorization_asn` field lets you pin requests authenticated via IP Authorization to a specific ASN. Provide the autonomous system number as a string; an optional `AS`/`as` prefix is accepted and stripped (so `AS7922` and `7922` are equivalent). Use the `available_asns` field to discover which ASNs can be targeted. ASN targeting is mutually exclusive with the other IP Authorization geo filters — only one of `ip_authorization_asn`, `ip_authorization_state`, `ip_authorization_city`, or `ip_authorization_postalcode` may be set at a time. It also cannot be combined with `ip_authorization_country_codes`, because the configured country would override the ASN. Set `ip_authorization_asn` to `null` to disable it. [Download replaced proxy list](https://apidocs.webshare.io/proxy-replacement/replaced_proxy/download "Download replaced proxy list") [Get proxy stats](https://apidocs.webshare.io/proxy-config/get_proxy_stats "Get proxy stats") --- # Create IP authorization – Webshare API Docs [IP Authorization](https://apidocs.webshare.io/ipauthorization) Create IP authorization Create IP authorization ======================= This endpoint lets you create an IP authorization. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/ipauthorization/create#parameters) | Attributes | Types | Description | | --- | --- | --- | | `ip_address` | `string` | The IP address to authorize. May return 400 error if this IP address is already authorized in the system. | ### Request & Response[](https://apidocs.webshare.io/ipauthorization/create#request--response) POST https://proxy.webshare.io/api/v2/proxy/ipauthorization/ or in case of targeting a specific plan POST https://proxy.webshare.io/api/v2/proxy/ipauthorization/?plan_id= PythonJavascriptcURL create\_ip\_authorization.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/proxy/ipauthorization/", json={"ip_address": "10.1.2.3"}, headers={"Authorization": "Token APIKEY"}) response.json() The commands above return a `201 Created` response with JSON structured like this: response.json { "id": 1337, "ip_address": "10.1.2.3", "created_at": "2022-06-14T11:58:10.246406-07:00", "last_used_at": null } [IP Authorization](https://apidocs.webshare.io/ipauthorization "IP Authorization") [List IP authorizations](https://apidocs.webshare.io/ipauthorization/list "List IP authorizations") --- # Create proxy replacement – Webshare API Docs [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement) [Proxy Replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement) Create replacement Create proxy replacement ======================== This endpoint lets you create a proxy replacement which replaces proxies from your proxy list. The `proxies_removed` and `proxies_added` must always match. Cannot create proxy replacement if `plan.pool_filter` is `residential`. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. This API is an Asynchronous API which means it will return a proxy replacement request with validating state, you will need to keep calling [retrive endpoint](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve) to get the last updates on that request until it's completed. POST https://proxy.webshare.io/api/v3/proxy/replace/ or in case of targeting a specific plan POST https://proxy.webshare.io/api/v3/proxy/replace/?plan_id= ### Parameters[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#parameters) | Attributes | Type | Description | | --- | --- | --- | | `to_replace` | `dict` | Dictionary indicating which proxies to replace. | | `replace_with` | `list` | List of dictionaries indicating which proxies to replace with. | | `dry_run` | `bool` | You can dry-run a replacement to learn number of proxies removed/added prior to actually replacing the proxy list. `dry_run=True` does not modify the proxy list. You can check the state of the replacement by calling retriving endpoint. | ### Request & Response[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#request--response) #### Replace With Country[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#replace-with-country) Available countries can be retrieved using [Proxy Configuration](https://apidocs.webshare.io/proxy-config) PythoncURL create\_replacement.py import requests response = requests.post( "https://proxy.webshare.io/api/v3/proxy/replace/", json={ "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "country", "country_code": "US"}], "dry_run": False }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 98315, "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "country", "country_code": "US"}], "dry_run": false, "state": "validating", "proxies_removed": null, "proxies_added": null, "reason": "", "error": null, "error_code": null, "created_at": "2022-07-26T21:25:13.966946-07:00", "dry_run_completed_at": null, "completed_at": null } #### Replace With ASN[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#replace-with-asn) Available ASNs can be retrieved using [Proxy Configuration](https://apidocs.webshare.io/proxy-config) PythonJavaScriptcURL create\_replacement.py import requests response = requests.post( "https://proxy.webshare.io/api/v3/proxy/replace/", json={ "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "asn", "asn_numbers": ["2914"]}], "dry_run": False }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 98315, "reason": "proxy_replaced", "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "asn", "asn_numbers": ["2914"]}], "dry_run": false, "state": "completed", "proxies_removed": 1, "proxies_added": 1, "created_at": "2022-07-26T21:25:13.966946-07:00", "completed_at": "2022-07-26T21:25:13.966946-07:00" } #### Replace With IP range[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#replace-with-ip-range) Available IP ranges can be retrieved using [Proxy Configuration](https://apidocs.webshare.io/proxy-config) PythonJavaScriptcURL create\_replacement.py import requests response = requests.post( "https://proxy.webshare.io/api/v3/proxy/replace/", json={ "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "ip_range", "ip_ranges": ["1.2.3.4/8"]}], "dry_run": False }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 98315, "reason": "proxy_replaced", "to_replace": {"type": "ip_range", "ip_ranges": ["1.2.3.0/24"]}, "replace_with": [{"type": "ip_range", "ip_ranges": ["1.2.3.4/8"]}], "dry_run": false, "state": "completed", "proxies_removed": 1, "proxies_added": 1, "created_at": "2022-07-26T21:25:13.966946-07:00", "completed_at": "2022-07-26T21:25:13.966946-07:00" } #### Replace With Random IPs[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#replace-with-random-ips) PythonJavaScriptcURL create\_replacement.py import requests response = requests.post( "https://proxy.webshare.io/api/v3/proxy/replace/", json={ "to_replace": {"type": "ip_address", "ip_addresses": ["1.2.3.4","1.2.3.5"]}, "replace_with": [{"type": "any", "count": 2}], "dry_run": False }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 98315, "reason": "proxy_replaced", "to_replace": {"type": "ip_address", "ip_addresses": ["1.2.3.4","1.2.3.5"]}, "replace_with": [{"type": "any", "count": 2}], "dry_run": false, "state": "completed", "proxies_removed": 1, "proxies_added": 1, "created_at": "2022-07-26T21:25:13.966946-07:00", "completed_at": "2022-07-26T21:25:13.966946-07:00" } ### 400 Error Types[](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_create#400-error-types) | Error Code | HTTP Code | Description | | --- | --- | --- | | `active_replacement` | `400` | You are already replacing a proxy. Please wait a moment and try again. | | `not_enough_replacements_in_subscription` | `400` | You have 1 proxy replacements remaining. Upgrade subscription to receive more replacements. | | `invalid` | `400` | Your proxy list is not editable | [Get replacement](https://apidocs.webshare.io/proxy-replacement/proxy_replacement/proxy_replacement_retrieve "Get replacement") [Replaced Proxy](https://apidocs.webshare.io/proxy-replacement/replaced_proxy "Replaced Proxy") --- # List IP Authorization – Webshare API Docs [IP Authorization](https://apidocs.webshare.io/ipauthorization) List IP authorizations List IP Authorization ===================== This endpoint returns the proxy IP authorizations in [paginated](https://apidocs.webshare.io/#pagination) format. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Request & Response[](https://apidocs.webshare.io/ipauthorization/list#request--response) GET https://proxy.webshare.io/api/v2/proxy/ipauthorization/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/proxy/ipauthorization/?plan_id= PythonJavascriptcURL list\_ip\_authorization.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/ipauthorization/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1337,\ "ip_address": "10.1.2.3",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "last_used_at": null\ },\ ...\ ] } [Create IP authorization](https://apidocs.webshare.io/ipauthorization/create "Create IP authorization") [Get IP authorization](https://apidocs.webshare.io/ipauthorization/retrieve "Get IP authorization") --- # Suspended – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Account suspended Account Suspended[](https://apidocs.webshare.io/verification/suspended#account-suspended) ------------------------------------------------------------------------------------------ If your account is suspended, all API requests will start returning the `403 Forbidden` status with the following error message. > 403 Forbidden { "detail": "Your account is suspended.", "code": "account_suspended" } [Submit evidence](https://apidocs.webshare.io/verification/submit_evidence "Submit evidence") [Verification thresholds](https://apidocs.webshare.io/verification/thresholds "Verification thresholds") --- # Get proxy status – Webshare API Docs [Proxy Configuration](https://apidocs.webshare.io/proxy-config) Get proxy status Get proxy status ================ This endpoint retrieves the proxy status. You need to add a query-string parameter `plan_id`. GET https://proxy.webshare.io/api/v3/proxy/list/status?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-config/get_proxy_status#request--response) PythonJavascriptcURL get\_proxy\_status.py import requests response = requests.get( "https://proxy.webshare.io/api/v3/proxy/list/status?plan_id=PLAN-ID", headers={ "Authorization": "Token APIKEY" } ) response.json() The commands above return JSON structured like this: response.json { "state": "completed", "countries": {"US": 5, "FR": 100}, "unallocated_countries": {}, "username": "username", "password": "password", "is_proxy_used": false } [Get proxy stats](https://apidocs.webshare.io/proxy-config/get_proxy_stats "Get proxy stats") [Get proxy config](https://apidocs.webshare.io/proxy-config/get_proxy_config "Get proxy config") --- # Get proxy config – Webshare API Docs [Proxy Configuration](https://apidocs.webshare.io/proxy-config) Get proxy config Get proxy config ================ This endpoint retrieves the proxy config. You need to add a query-string parameter `plan_id`. GET https://proxy.webshare.io/api/v3/proxy/config?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-config/get_proxy_config#request--response) PythonJavascriptcURL get\_proxy\_config.py import requests response = requests.get( "https://proxy.webshare.io/api/v3/proxy/config?plan_id=PLAN-ID", headers={ "Authorization": "Token APIKEY" } ) response.json() The commands above return JSON structured like this: response.json { "request_timeout": 86400, "request_idle_timeout": 900, "ip_authorization_country_codes": ["US", "FR"], "ip_authorization_city": "los_angeles", "ip_authorization_asn": null, "auto_replace_invalid_proxies": true, "auto_replace_low_country_confidence_proxies": false, "auto_replace_out_of_rotation_proxies": false, "auto_replace_failed_site_check_proxies": false, "proxy_list_download_token": "aa87abbc...zz" } [Get proxy status](https://apidocs.webshare.io/proxy-config/get_proxy_status "Get proxy status") [Update proxy config](https://apidocs.webshare.io/proxy-config/update "Update proxy config") --- # Get IP authorization – Webshare API Docs [IP Authorization](https://apidocs.webshare.io/ipauthorization) Get IP authorization Get IP authorization ==================== This endpoint lets you retrieve an IP authorization. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/ipauthorization/retrieve#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the IP authorization to retrieve. | ### Request & Response[](https://apidocs.webshare.io/ipauthorization/retrieve#request--response) GET https://proxy.webshare.io/api/v2/proxy/ipauthorization// or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/proxy/ipauthorization//?plan_id= PythonJavascriptcURL get\_ip\_authorization.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/ipauthorization//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1337, "ip_address": "10.1.2.3", "created_at": "2022-06-14T11:58:10.246406-07:00", "last_used_at": null } [List IP authorizations](https://apidocs.webshare.io/ipauthorization/list "List IP authorizations") [Delete IP authorization](https://apidocs.webshare.io/ipauthorization/delete "Delete IP authorization") --- # Submit security code – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Submit security code Submit security code ==================== This endpoint lets you submit a security code for a verification flow that is two alphanumeric characters you can find in Webshare charges in your bank statement. ### Parameters[](https://apidocs.webshare.io/verification/submit_security_code#parameters) | Parameter | Type | Description | | --- | --- | --- | | `Verification ID` | `string` | The ID of the verification flow, this parameter should be a route parameter included in the URL. | | `security_code` | `string` | The security code you want to submit. | ### Examples[](https://apidocs.webshare.io/verification/submit_security_code#examples) PythonJavascriptcURL submit-security-code.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/verification/flow//submit_verification_code/", json={ "security_code":"XX" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: { "id": 1, "type": "acceptable_use_violation", "state": "successful_verification", "started_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "needs_evidence": false, "id_verification_restores_access": false, "id_verification_required": false } [Submit an answer](https://apidocs.webshare.io/verification/submit_answer "Submit an answer") [List appeals](https://apidocs.webshare.io/verification/list_appeals "List appeals") --- # Referral Info – Webshare API Docs [Referral & Affiliate](https://apidocs.webshare.io/referral) Referral Info (Public) Referral Info ============= Get Referral Code Info[](https://apidocs.webshare.io/referral/referral_info#get-referral-code-info) ---------------------------------------------------------------------------------------------------- Retrieve the information of a referral code. Contains publicly available information such as referral code promotion codes. | Attributes | Type | Description | | --- | --- | --- | | `referral_code` | `string` | The referral code to use. | | `promo_type` | `string` | The type of promotion. May be `first_time_value_off`, `first_time_percent_off`, `always_value_off` or `always_percent_off`. May be set to `null`. | | `promo_value` | `integer` | The value of the promotion. May be `10` or `20`. May be set to `null` if `promo_type` is `null`. | ### Request & Response[](https://apidocs.webshare.io/referral/referral_info#request--response) | Parameter | Type | Description | | --- | --- | --- | | `referral_code` | `string` | The referral code to use. | GET https://proxy.webshare.io/api/v2/referral/code/info/?referral_code={referral_code} PythonJavascriptcURL example.py import requests response = requests.get("https://proxy.webshare.io/api/v2/referral/code/info/?referral_code={referral_code}") response.json() The commands above return JSON structured like this: response.json { "promo_type": "first_time_value_off", "promo_value": 10, "referral_code": "a8b192klkwncvk" } [Coupon Code](https://apidocs.webshare.io/referral/coupon_code "Coupon Code") [Account Verification](https://apidocs.webshare.io/verification "Account Verification") --- # Retrieve verification – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Retrieve verification Retrieve verification ===================== This endpoint lets you retrieve an account verification. ### URL Parameters[](https://apidocs.webshare.io/verification/retrieve#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `integer` | The ID of the verification object. | ### Examples[](https://apidocs.webshare.io/verification/retrieve#examples) GET https://proxy.webshare.io/api/v2/verification/flow// PythoncURL verification-flow.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/flow//", headers={"Authorization": "Token APIKEY"} ) response.json() response.json { "id": 1, "type": "acceptable_use_violation", "state": "inflow", "started_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "needs_evidence": false, "evidence": { "id": 2, "explanation": "User explanation", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "files": [\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationevidence/file1",\ "id": 5\ },\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationevidence/file2",\ "id": 6\ }\ ] }, "id_verification_restores_access": false, "id_verification_required": false } [List verifications](https://apidocs.webshare.io/verification/list "List verifications") [Submit evidence](https://apidocs.webshare.io/verification/submit_evidence "Submit evidence") --- # What's my IP – Webshare API Docs [IP Authorization](https://apidocs.webshare.io/ipauthorization) What's my IP? What's my IP ============ This endpoint lets you get your public IP address. It may be useful for IP Authorization purposes. ### Request & Response[](https://apidocs.webshare.io/ipauthorization/whatsmyip#request--response) GET https://proxy.webshare.io/api/v2/proxy/ipauthorization/whatsmyip/ PythonJavascriptcURL whatsmyip.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/ipauthorization/whatsmyip/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "ip_address": "1.2.3.4" } [Delete IP authorization](https://apidocs.webshare.io/ipauthorization/delete "Delete IP authorization") [Proxy Statistics](https://apidocs.webshare.io/proxystats "Proxy Statistics") --- # Abuse reports – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Abuse reports Abuse reports ============= This endpoint returns the abuse reports that are raised against your account in [paginated](https://apidocs.webshare.io/#pagination) format. In case the account is suspended the account verification flow ID will come with the response. ### Examples[](https://apidocs.webshare.io/verification/list_abuse_reports#examples) PythonJavascriptcURL list-abuse-reports.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/abuse_report/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "content": "The content of the abuse report",\ "flow": 1,\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ },\ ...\ ] } [Submit an appeal](https://apidocs.webshare.io/verification/submit_appeal "Submit an appeal") [View suspension](https://apidocs.webshare.io/verification/view_suspension "View suspension") --- # Proxy Statistics – Webshare API Docs Proxy Statistics Proxy Statistics ================ You can use the Webshare API to retrieve the proxy statistics. The proxy statistics object[](https://apidocs.webshare.io/proxystats#the-proxy-statistics-object) -------------------------------------------------------------------------------------------------- Proxy stats are by default aggregated every 1 hour. ### Attributes[](https://apidocs.webshare.io/proxystats#attributes) | Attributes | Type | Description | | --- | --- | --- | | `timestamp` | `string` | The timestamp of the stat. The stats are always aggregated for 1 hour (3,600 seconds). All timestamps have 00:00 minute&second. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format. | | `is_projected` | `boolean` | Indicates whether the stat is projected or real. You may request projected stats for the future. | | `bandwidth_total` | `integer` | Total bandwidth use in bytes for the 1 hour window. | | `bandwidth_average` | `integer` | Average bandwidth in bytes per request. Calculated by `bandwidth_total/requests_total`. | | `requests_total` | `integer` | Number of proxy requests made. | | `requests_successful` | `integer` | Number of proxy requests succeeded. | | `requests_failed` | `integer` | Number of proxy requests failed. | | `error_reasons` | `array` | List of error reasons. Detailed attributes can be found in the table below. Set to `[]` if `is_projected=True`. | | `countries_used` | `object` | Number of proxy requests per [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
. Set to `{}` if `is_projected=True`. | | `number_of_proxies_used` | `integer` | Number of unique proxy addresses used (estimated). If backbone proxy is used, the number of unique assigned IP addresses are counted. Set to `0` if `is_projected=True`. | | `protocols_used` | `object` | Number of requests per proxy protocol. Proxy protocols can be `http` or `socks`. Set to `{}` if `is_projected=True`. | | `average_concurrency` | `number` | Average number of concurrent proxy request (estimated). Set to `null` if `is_projected=True`. | | `average_rps` | `number` | Average proxy requests per second (estimated). Set to `null` if `is_projected=True`. | | `last_request_sent_at` | `string` | The time last proxy request was sent. Must be within the 1 hour window. Set to `null` if `is_projected=True`. | ### Error reason attributes[](https://apidocs.webshare.io/proxystats#error-reason-attributes) | Attributes | Type | Description | | --- | --- | --- | | `reason` | `string` | Code for the error. The same code is present in the `X-Webshare-Error-Reason` header when making requests to the HTTP proxy endpoint. | | `type` | `string` | Whether the error is a `configuration` or `connection` error. | | `how_to_fix` | `string` | Guide for the end-user on how to fix the error. | | `http_status` | `integer` | HTTP response status code the HTTP proxy endpoint may return for this particular error. May be `null`. | | `count` | `integer` | Number of failed proxy requests with this error reason. | ### In JSON format[](https://apidocs.webshare.io/proxystats#in-json-format) { "timestamp": "2022-08-11T17:00:00-07:00", "is_projected": false, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" } [What's my IP?](https://apidocs.webshare.io/ipauthorization/whatsmyip "What's my IP?") [List statistics](https://apidocs.webshare.io/proxystats/list_stats "List statistics") --- # Update proxy config – Webshare API Docs [Proxy Configuration](https://apidocs.webshare.io/proxy-config) Update proxy config Update proxy config =================== This endpoint updates the proxy config. See [Proxy Config Object](https://apidocs.webshare.io/proxy-config#the-proxy-config-object) for fields that can be updated. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. PATCH https://proxy.webshare.io/api/v2/proxy/config/ or in case of targeting a specific plan PATCH https://proxy.webshare.io/api/v2/proxy/config/?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-config/update#request--response) PythonJavascriptcURL update\_proxy\_config.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/proxy/config/", json={ "username":"new_username" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "completed", "countries": {"US": 5, "FR": 100}, "available_countries": {"US": 95}, "unallocated_countries": {}, "ip_ranges_24": {"10.1.1.0/24": 5, "10.1.3.0/24": 100}, "ip_ranges_16": {"10.1.0.0/16": 105}, "ip_ranges_8": {"10.0.0.0/8": 105}, "available_ip_ranges_24": {"1.2.3.0/24": 100}, "available_ip_ranges_16": {"1.2.0.0/16": 100}, "available_ip_ranges_8": {"1.0.0.0/8": 100}, "asns": {"6137": ["ASN NAME", 105]}, "available_asns": {"9421": ["ASN NAME", 105]}, "username": "new_username", "password": "password", "request_timeout": 86400, "request_idle_timeout": 900, "ip_authorization_country_codes": ["US", "FR"], "ip_authorization_city": "los_angeles", "ip_authorization_asn": null, "auto_replace_invalid_proxies": true, "auto_replace_low_country_confidence_proxies": false, "auto_replace_out_of_rotation_proxies": false, "auto_replace_failed_site_check_proxies": false, "proxy_list_download_token": "aa87abbc...zz", "is_proxy_used": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Get proxy config](https://apidocs.webshare.io/proxy-config/get_proxy_config "Get proxy config") [Assign unallocated countries](https://apidocs.webshare.io/proxy-config/allocate_unallocated_countries "Assign unallocated countries") --- # Delete IP Authorization – Webshare API Docs [IP Authorization](https://apidocs.webshare.io/ipauthorization) Delete IP authorization Delete IP Authorization ======================= This endpoint lets you delete an IP authorization. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/ipauthorization/delete#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the IP authorization to delete. | ### Request & Response[](https://apidocs.webshare.io/ipauthorization/delete#request--response) DELETE https://proxy.webshare.io/api/v2/proxy/ipauthorization// or in case of targeting a specific plan DELETE https://proxy.webshare.io/api/v2/proxy/ipauthorization//?plan_id= PythonJavascriptcURL delete\_ip\_authorization.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/proxy/ipauthorization//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above returns empty response with `204 No Content` HTTP/1.1 204 No Content [Get IP authorization](https://apidocs.webshare.io/ipauthorization/retrieve "Get IP authorization") [What's my IP?](https://apidocs.webshare.io/ipauthorization/whatsmyip "What's my IP?") --- # Proxy Activity – Webshare API Docs [Proxy Statistics](https://apidocs.webshare.io/proxystats) Activity object Proxy Activity ============== A new proxy activity is created for all proxy requests which are successfully authenticated through Webshare Proxy. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. The Proxy Activity Object[](https://apidocs.webshare.io/proxystats/activity_object#the-proxy-activity-object) -------------------------------------------------------------------------------------------------------------- | Attributes | Type | Description | | --- | --- | --- | | `timestamp` | `string` | The timestamp of the proxy request. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format. | | `protocol` | `string` | Indicates the proxy protocol. Can be `http` or `socks`. | | `request_duration` | `number` | Total proxy request duration in seconds. | | `handshake_duration` | `number` | Total duration to authenticate and establish a proxy connection in seconds. You can consider this time as the overhead of proxy connection. | | `tunnel_duration` | `number` | Total duration in seconds the proxy connection stayed active after handshake was completed. May be `null`. | | `error_reason` | `string` | Error reason for the proxy request. May be `null`. | | `error_reason_how_to_fix` | `string` | User-friendly explanation on how to fix this error. May be `null`. | | `auth_username` | `string` | The proxy username used for this proxy request. Only set if `error_reason=no_proxies_allocated`. May be `null`. | | `proxy_address` | `string` | The IP address of the proxy use to access to the target site. For backbone proxy, this address would correspond to assigned IP address. May be `null`. This field is set to `null` if `plan.pool_filter` is `residential`. | | `bytes` | `number` | Number of bytes consumed by this proxy request. Calculated by summing up all downloaded and uploaded data. | | `client_address` | `string` | The IP address you have used to connect to the proxy server. | | `ip_address` | `string` | The IP address of the target site. May be `null`. | | `hostname` | `string` | The hostname of the target site. May be `null`. | | `domain` | `string` | The domain name of the target site. May be `null`. | | `port` | `number` | The port the target site. May be `null`. | | `proxy_port` | `number` | The source port used to connect to the target site. May be `null`. | | `listen_address` | `string` | The IP address of the proxy server you have connected to. If you have used the Direct Connection mode, this field will be equal to `proxy_address`. | | `listen_port` | `number` | The port of the proxy server you have connected to. | In JSON format[](https://apidocs.webshare.io/proxystats/activity_object#in-json-format) ---------------------------------------------------------------------------------------- { "timestamp": "2022-08-16T15:29:42.517523-07:00", "protocol": "http", "request_duration": 0.5, "handshake_duration": 0.3, "tunnel_duration": 0.2, "error_reason": "client_connect_forbidden_host", "error_reason_how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.", "auth_username": null, "proxy_address": "192.168.5.1", "bytes": 0, "client_address": "10.1.0.1", "ip_address": "10.1.0.2", "hostname": "ipv4.webshare.io", "domain": "webshare.io", "port": 443, "proxy_port": null, "listen_address": "192.168.5.24", "listen_port": 6455 } [Aggregate statistics](https://apidocs.webshare.io/proxystats/aggregate "Aggregate statistics") [List proxy activities](https://apidocs.webshare.io/proxystats/list_activity "List proxy activities") --- # Renew the subscription – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Renew the subscription Renew the subscription ====================== You can use this API to renew the subscription. After renewal, you will receive additional `subscription.renewals_paid`. | Attributes | Type | Description | | --- | --- | --- | | `payment_method` | `int` | The payment method to use. Can be `null` to use the payment on file, or an existing payment method id. | | `term` | `string` | The term to renew. Can be `yearly` or `monthly`. | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). Optional: Only required if a payment is required. If using account credits, no recaptcha is required. | This API endpoint requires recaptcha validation if a payment is required. If you have enough account credits, no payment is required. When a payment is required you should not be using this API endpoint programmatically and only use it from the Webshare Dashboard. ### Request & Response[](https://apidocs.webshare.io/subscription/renew#request--response) POST https://proxy.webshare.io/api/v2/subscription/checkout/renew/ PythonJavascriptcURL list\_ip\_authorization.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subscription/checkout/renew/", json={ "term": "monthly", "payment_method": 3, "recaptcha": "...", }, headers={"Authorization": "Token APIKEY"}, ) response.json() The commands above return JSON structured like this: response.json { "payment_required": true, "plan": 2, "pending_payment": 3, "stripe_client_secret": "...", "stripe_payment_intent": "...", "stripe_payment_method": "..." } [Purchase a plan](https://apidocs.webshare.io/subscription/purchase_plan "Purchase a plan") [Auto-renewal](https://apidocs.webshare.io/subscription/auto_renewal "Auto-renewal") --- # Aggregate stats – Webshare API Docs [Proxy Statistics](https://apidocs.webshare.io/proxystats) Aggregate statistics Aggregate stats =============== Aggregate the proxy stats for the given period. Useful for showing the total proxy use in the subscription period. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/proxystats/aggregate#parameters) | Parameter | Type | Description | | --- | --- | --- | | `timestamp__lte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be less than this. If given a date in the future, projected stats will be included for each hour between now and the given date. Cannot be after the `subscription.end_date`. | | `timestamp__gte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be greater than this. Must be before the `timestamp__lte` field. Cannot be older than 90 days from today. | ### Request & Response[](https://apidocs.webshare.io/proxystats/aggregate#request--response) GET https://proxy.webshare.io/api/v2/stats/aggregate/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/stats/aggregate/?plan_id= PythonJavascriptcURL aggregate.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/stats/aggregate/", { "timestamp__lte":"2022-09-09T23:34:00.095501-07:00", "timestamp__gte":"2022-08-09T23:34:00.095501-07:00" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" } [List statistics](https://apidocs.webshare.io/proxystats/list_stats "List statistics") [Activity object](https://apidocs.webshare.io/proxystats/activity_object "Activity object") --- # Auto-renewal – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Auto-renewal Auto-renewal ============ You can use these API endpoints to manage the auto-renewal setting for a subscription. ⚠️ Auto-renewal cannot be modified for free plans. Cancel auto-renewal[](https://apidocs.webshare.io/subscription/auto_renewal#cancel-auto-renewal) ------------------------------------------------------------------------------------------------- This endpoint cancels the auto-renewal for the subscription. When auto-renewal is cancelled, the subscription will not be automatically renewed at the end of the current term and the payment method will be removed. ### Request & Response[](https://apidocs.webshare.io/subscription/auto_renewal#request--response) DELETE https://proxy.webshare.io/api/v2/subscription/renewal/ PythonJavascriptcURL cancel\_auto\_renewal.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/subscription/renewal/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return a [subscription object](https://apidocs.webshare.io/subscription) with `renewals_enabled` set to `false`: response.json { "id": 1, "plan": 2, "payment_method": null, "free_credits": 13.37, "term": "monthly", "start_date": "2022-06-14T11:19:14.489458-07:00", "end_date": "2022-07-14T11:19:14.489461-07:00", "renewals_paid": 0, "renewals_enabled": false, "failed_payment_times": 0, "account_discount_percentage": 0, "promotion_available_first_time_renewal_25_off": false, "customizable": true, "paused": false, "reactivation_date": null, "reactivation_period_left": null, "promo_type": null, "promo_value": null, "retention_discount_resi_20_available": false, "throttled": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Renew the subscription](https://apidocs.webshare.io/subscription/renew "Renew the subscription") [Retention offer](https://apidocs.webshare.io/subscription/retention_offer "Retention offer") --- # Download Invoice – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Download invoice This endpoint returns the invoice as a PDF file. GET https://proxy.webshare.io/api/v2/invoices/download?subscription_transaction_id={subscription_transaction_id} ### Parameters[](https://apidocs.webshare.io/subscription/download_invoice#parameters) | Key | Type | Description | | --- | --- | --- | | `subscription_transaction_id` | `string` | The unique identifier of the subscription transaction. | ### Request & Response[](https://apidocs.webshare.io/subscription/download_invoice#request--response) PythonJavascriptcURL download\_invoice\_pdf.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/invoices/download?subscription_transaction_id={subscription_transaction_id}", headers={ "Authorization": "Token APIKEY" } ) The commands above return a PDF file. [Retention offer](https://apidocs.webshare.io/subscription/retention_offer "Retention offer") [Payments & Billing](https://apidocs.webshare.io/billing "Payments & Billing") --- # Download proxy activities – Webshare API Docs [Proxy Statistics](https://apidocs.webshare.io/proxystats) Download proxy activities Download proxy activities ========================= This API does not require authentication. You can download the proxy activities list as a file using the link below. This link use a token that can be retrieved from the [Get Download Token](https://apidocs.webshare.io/downloads/get_download_token) API with the scope "activity". You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. GET https://proxy.webshare.io/api/v2/proxy/activity/download/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/proxy/activity/download/?plan_id= ### Parameters[](https://apidocs.webshare.io/proxystats/download_activity#parameters) | Parameter | Type | Description | | --- | --- | --- | | `download_token` | `string` | Token retrieved from the [Get Download Token](https://apidocs.webshare.io/downloads/get_download_token)
API with the scope 'activity' | | `timestamp__lte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be less than this. If given a date in the future, projected stats will be included for each hour between now and the given date. Cannot be after the `subscription.end_date`. Default is now. | | `timestamp__gte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be greater than this. Must be before the `timestamp__lte` field. Cannot be older than 90 days from today. Default is six days ago. | | `search` | `string` | Generic search query. | | `error_reason` | `string` | Match only requests with the given error\_reason. You can pass `*` to filter for only requests with an error. | | `starting_after` | `string` | Only proxy activities after this timestamp are included in the exported CSV file. The download is a single file and is not paginated. | | `bytes__gte` | `string` | Filter requests with bytes equal or greater than the given value. | | `bytes__lte` | `string` | Filter requests with bytes equal or less than the given value. | ### Request & Response[](https://apidocs.webshare.io/proxystats/download_activity#request--response) PythonJavascriptcURL download\_activity\_list.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/activity/download/", { "download_token": DOWNLOAD_TOKEN } ) response.text The commands above return CSV file in the following format: response Time,Hostname,Destination Port,Bytes,Duration,Proxy,Your IP Address,Error Reason,Protocol 2023-10-16 23:38:51.384785-07:00,test.dev.webshare.io,443,102400,0.3,178.62.198.117,10.1.0.1,None,http 2023-10-16 22:38:51.354124-07:00,test.dev.webshare.io,443,153600,0.3,138.201.46.150,10.1.0.1,None,http 2023-10-16 21:38:51.761951-07:00,test.dev.webshare.io,443,204800,0.3,76.14.29.153,10.1.0.1,None,http [List proxy activities](https://apidocs.webshare.io/proxystats/list_activity "List proxy activities") [Subscription](https://apidocs.webshare.io/subscription "Subscription") --- # Categories – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Verification categories Verification Categories[](https://apidocs.webshare.io/verification/categories#verification-categories) ------------------------------------------------------------------------------------------------------- This API lets you retrieve information about the different verification categories that may trigger verification flows. Each category represents a specific type of proxy usage pattern that may require verification. ### Parameters[](https://apidocs.webshare.io/verification/categories#parameters) | Parameter | Type | Description | | --- | --- | --- | | `description` | `string` | Description of the verification category. Can be user visible. | | `request_threshold` | `null` | Previously indicated the threshold number of requests that would trigger verification for this category. Now always returns null. | | `id_verification_required` | `boolean` | Whether this verification category requires ID verification when triggered. | | `id_verification_restores_access` | `boolean` | Whether this verification category restores proxy access when ID verification is completed. | ### Examples[](https://apidocs.webshare.io/verification/categories#examples) import requests response = requests.get("https://proxy.webshare.io/api/v2/verification/categories/") response.json() curl "https://proxy.webshare.io/api/v2/verification/categories/" \ -H "Authorization: Token APIKEY" > The above command returns JSON structured like this: { "requests_to_authentication_pages": { "description": "Large number of requests to login/sign-up pages requires additional verification. Large number of login attempts with different credentials is strictly forbidden. Signing up for large number of accounts on some platforms may require ID verification.", "request_threshold": null, "id_verification_required": false, "id_verification_restores_access": false }, "requests_to_financial_institutions": { "description": "Large number of requests to payment pages, banks or any other financial institutions requires ID verification to be completed.", "request_threshold": null, "id_verification_required": true, "id_verification_restores_access": true } } [Verification thresholds](https://apidocs.webshare.io/verification/thresholds "Verification thresholds") [Verification limits](https://apidocs.webshare.io/verification/limits "Verification limits") --- # Update payment method – Webshare API Docs [Payments & Billing](https://apidocs.webshare.io/billing) Update Payment Method Update payment method ===================== You can use this API to update your payment method. The update payment method API uses only `recaptcha` field. This API endpoint requires recaptcha validation. ### Request fields[](https://apidocs.webshare.io/billing/update_payment_method#request-fields) | Parameter | Type | Description | | --- | --- | --- | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Response fields[](https://apidocs.webshare.io/billing/update_payment_method#response-fields) | Attributes | Type | Description | | --- | --- | --- | | `pending_payment` | `integer` | The ID of the PendingPayment instance. | | `stripe_client_secret` | `string` | The `client_secret` for the Stripe [SetupIntent](https://stripe.com/docs/js/setup_intents/confirm_setup)
. | | `stripe_setup_intent` | `string` | The ID of the Stripe [SetupIntent](https://stripe.com/docs/js/setup_intents/confirm_setup)
. | ### Request & Response[](https://apidocs.webshare.io/billing/update_payment_method#request--response) POST https://proxy.webshare.io/api/v2/payment/method/ PythonJavascriptcURL update\_payment\_method.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/payment/method/", json={ "recaptcha": "...", }, headers={"Authorization": "Token APIKEY"}, ) response.json() The commands above return JSON structured like this: response.json { "pending_payment": 3, "stripe_client_secret": "...", "stripe_payment_intent": "..." } [Pending payments](https://apidocs.webshare.io/billing/pending_payments "Pending payments") [Referral & Affiliate](https://apidocs.webshare.io/referral "Referral & Affiliate") --- # Submit Evidence – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Submit evidence Submit evidence[](https://apidocs.webshare.io/verification/submit_evidence#submit-evidence) -------------------------------------------------------------------------------------------- This endpoint lets you submit evidence for a verification. The encoding for this API must be `multipart/form-data`. You cannot send JSON content to this API. import requests response = requests.post( "https://proxy.webshare.io/api/v2/verification/flow//submit_evidence/", data={"explanation": "We use proxies to scrape pricing information from e-commerce websites."}, files={"files":[open("evidence.jpg")]}, headers={"Authorization": "Token APIKEY"} ) response.json() curl "https://proxy.webshare.io/api/v2/verification/flow//submit_evidence/" \ -F "explanation=We+use+proxies+to+scrape+pricing+information+from+e-commerce+websites.&files=@evidence.jpg" \ -H "Authorization: Token APIKEY" > The above command returns JSON structured like this: { "id": 1, "type": "acceptable_use_violation", "state": "inflow", "started_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "needs_evidence": false, "id_verification_restores_access": false, "id_verification_required": false } ### HTTP request[](https://apidocs.webshare.io/verification/submit_evidence#http-request) `POST https://proxy.webshare.io/api/v2/verification/flow//submit_evidence/` ### URL parameters[](https://apidocs.webshare.io/verification/submit_evidence#url-parameters) | Parameter | Description | | --- | --- | | ID | The ID of the verification object. | | explanation | The explanation submitted as part of the verification. | | files | List of files submitted as part of the verification. | [Retrieve verification](https://apidocs.webshare.io/verification/retrieve "Retrieve verification") [Account suspended](https://apidocs.webshare.io/verification/suspended "Account suspended") --- # Account Verification – Webshare API Docs Account Verification Account Verification ==================== Your Webshare account may require verification from time-to-time to continue operating. This section provides the API endpoints to check if a verification is required and submit evidence. Furthermore, you can view the format of API responses you may receive in case an account is suspended. The verification object[](https://apidocs.webshare.io/verification#the-verification-object) -------------------------------------------------------------------------------------------- You can use the API to retrieve information about your account verifications. ### Verification Object[](https://apidocs.webshare.io/verification#verification-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | Unique identifier of the verification instance. | | `type` | `string` | The type of the verification. Can be `acceptable_use_violation`, `abuse_report` or `fraudulent_payment`. | | `state` | `string` | The current state of the verification. Can be `inflow`, `successful_verification` or `failed_verification`. | | `started_at` | `string` | The timestamp of when this verification started. | | `updated_at` | `string` | The timestamp when this instance was last updated. | | `needs_evidence` | `bool` | Whether this verification requires evidence from the user. | | `evidence` | `object` | The evidence submitted for this verification. May be `null` if no evidence has been submitted. | | `id_verification_required` | `bool` | Whether an ID verification is required for this verification. | | `id_verification_restores_access` | `bool` | Whether completing the ID verification restores account access. | ### In JSON format[](https://apidocs.webshare.io/verification#in-json-format) verification\_object.json { "id": 1, "type": "acceptable_use_violation", "state": "inflow", "started_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "needs_evidence": false } [Referral Info (Public)](https://apidocs.webshare.io/referral/referral_info "Referral Info (Public)") [List verifications](https://apidocs.webshare.io/verification/list "List verifications") --- # Thresholds – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Verification thresholds Verification thresholds[](https://apidocs.webshare.io/verification/thresholds#verification-thresholds) ------------------------------------------------------------------------------------------------------- This API lets you retrieve the thresholds which may trigger an acceptable\_use\_violation verification flow. They are thresholds for the allowed number of requests under specific category like (Requests to financial institutions). If the user account is not in verification, these percentages will eventually will reset themselves. ### Parameters[](https://apidocs.webshare.io/verification/thresholds#parameters) | Parameter | Type | Description | | --- | --- | --- | | `description` | `string` | Description of the verification trigger. Can be user visible. | | `id_verification_required` | `boolean` | Whether this verification threshold requires ID verification when triggered. | | `id_verification_restores_access` | `boolean` | Whether this verification threshold restores proxy access when ID verification is completed. | | `request_count` | `number` | Number of proxy requests sent matching this verification trigger. | | `request_threshold` | `null` | Previously indicated the number of proxy requests which would trigger this threshold. Now always returns null. | | `triggered` | `boolean` | Whether this verification threshold has been triggered. | ### Examples[](https://apidocs.webshare.io/verification/thresholds#examples) import requests response = requests.get("https://proxy.webshare.io/api/v2/verification/thresholds/") response.json() curl "https://proxy.webshare.io/api/v2/verification/thresholds/" \ -H "Authorization: Token APIKEY" > The above command returns JSON structured like this: { "requests_to_authentication_pages": { "description": "Large number of requests to login/sign-up pages requires additional verification. Large number of login attempts with different credentials is strictly forbidden. Signing up for large number of accounts on some platforms may require ID verification.", "id_verification_required": false, "id_verification_restores_access": false, "request_count": 50000, "request_threshold": null, "triggered": true }, "requests_to_financial_institutions": { "description": "Large number of requests to payment pages, banks or any other financial institutions requires ID verification to be completed.", "id_verification_required": false, "id_verification_restores_access": false, "request_count": 0, "request_threshold": null, "triggered": false } } [Account suspended](https://apidocs.webshare.io/verification/suspended "Account suspended") [Verification categories](https://apidocs.webshare.io/verification/categories "Verification categories") --- # List appeals – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) List appeals List appeals ============ This endpoint returns the appeals you have submited for your account in [paginated](https://apidocs.webshare.io/#pagination) format. ### Parameters[](https://apidocs.webshare.io/verification/list_appeals#parameters) | Parameter | Type | Description | | --- | --- | --- | | `state` | `string` | Match only appeals that are under a specific state. Can be `approved`, `rejected` or `submitted`. | ### Examples[](https://apidocs.webshare.io/verification/list_appeals#examples) PythonJavascriptcURL list-appeals.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/appeal/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "appeal": "The appeal for account suspension you want to submit",\ "state": "submitted",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ },\ ...\ ] } [Submit security code](https://apidocs.webshare.io/verification/submit_security_code "Submit security code") [Submit an appeal](https://apidocs.webshare.io/verification/submit_appeal "Submit an appeal") --- # List verifications – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) List verifications List verifications ================== This endpoint returns the account verifications in [paginated](https://apidocs.webshare.io/#pagination) format. ### Examples[](https://apidocs.webshare.io/verification/list#examples) PythoncURL list-verifications.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/flow/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "type": "acceptable_use_violation",\ "state": "inflow",\ "started_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "needs_evidence": false,\ "evidence": {\ "id": 2,\ "explanation": "User explanation",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "files": [\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationevidence/file1",\ "id": 5\ },\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationevidence/file2",\ "id": 6\ }\ ]\ },\ "id_verification_restores_access": false,\ "id_verification_required": false\ },\ ...\ ] } [Account Verification](https://apidocs.webshare.io/verification "Account Verification") [Retrieve verification](https://apidocs.webshare.io/verification/retrieve "Retrieve verification") --- # List questions – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) List questions List questions ============== This endpoint returns the questions submited by compliance team in [paginated](https://apidocs.webshare.io/#pagination) format. ### Parameters[](https://apidocs.webshare.io/verification/list_questions#parameters) | Parameter | Type | Description | | --- | --- | --- | | `flow__type` | `string` | Match only question objects when the verification flow is under a specific type. Can be `acceptable_use_violation`, `abuse_report` or `fraudulent_payment`. | | `flow__state` | `string` | Match only question objects when the verification flow is under a specific state. Can be `inflow`, `successful_verification` or `failed_verification`. | | `answer__isnull` | `string` | Set to `True` to show only questions without answers. Set to `False` to show only question with answers | | `flow__started_at__gte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the verification flow's start date will be greater than this. | | `flow__started_at__lte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the verification flow's start date will be less than this. | | `question` | `string` | Match only question objects with the given question. | | `answer__answer` | `boolean` | Match only question objects with the given answer. | ### Examples[](https://apidocs.webshare.io/verification/list_questions#examples) PythonJavascriptcURL list-questions.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/question/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this (If the question doesn't have an answer yet the answer field will come as null): response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "question": "The question",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "flow": 2,\ "answer": {\ "id": 1,\ "answer": "The answer submitted by the user",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "files": [\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationanswer/evidence",\ "id": 5\ }\ ]\ }\ },\ ...\ ] } [Verification limits](https://apidocs.webshare.io/verification/limits "Verification limits") [Submit an answer](https://apidocs.webshare.io/verification/submit_answer "Submit an answer") --- # Limits – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Verification limits Verification limits[](https://apidocs.webshare.io/verification/limits#verification-limits) ------------------------------------------------------------------------------------------- This API lets you retrieve the verification limits which your account may have received ### Parameters[](https://apidocs.webshare.io/verification/limits#parameters) | Parameter | Type | Description | | --- | --- | --- | | `proxy_state` | `string` | Can be 'active', 'limited' or 'paused'. Limited means proxies are slower than usual and may give errors while using. Paused means proxy are currently not working. | ### Examples[](https://apidocs.webshare.io/verification/limits#examples) import requests response = requests.get("https://proxy.webshare.io/api/v2/verification/limits/") response.json() curl "https://proxy.webshare.io/api/v2/verification/limits/" \ -H "Authorization: Token APIKEY" > The above command returns JSON structured like this: { "proxy_state": "active" } [Verification categories](https://apidocs.webshare.io/verification/categories "Verification categories") [List questions](https://apidocs.webshare.io/verification/list_questions "List questions") --- # Submit answer – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Submit an answer Submit answer ============= This endpoint lets you submit an answer for a verification question with attachments. The encoding for this API must be `multipart/form-data`. ### Parameters[](https://apidocs.webshare.io/verification/submit_answer#parameters) | Parameter | Type | Description | | --- | --- | --- | | `Question ID` | `string` | The ID of the question to submit an answer to, this parameter should be a route parameter included in the URL. | | `answer` | `string` | The payload for this endpoint will be a JSON with property 'answer' which is the answer to the question. | | `files` | `array` | Array of attachments you want to submit with the answer, the attachments are optional. | ### Examples[](https://apidocs.webshare.io/verification/submit_answer#examples) PythoncURL submit-answer.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/verification/question//answer/", data={ "answer":"The answer to the question" }, files={"files":[open("evidence.jpg")]}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "answer": "The answer submitted by the user", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "files": [\ {\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "file": "verificationanswer/evidence",\ "id": 5\ }\ ] } [List questions](https://apidocs.webshare.io/verification/list_questions "List questions") [Submit security code](https://apidocs.webshare.io/verification/submit_security_code "Submit security code") --- # Complete verification – Webshare API Docs [ID Verification](https://apidocs.webshare.io/idverification) Complete ID verification Complete verification ===================== You can notify the API to process a verification after you have completed it with Stripe JS. In order to complete a verification, the state has to be `pending`. When you complete a verification successfully, the state will become `processing`. If the Stripe JS ID verification is not completed, the API will return a 400 error. Complete verification request[](https://apidocs.webshare.io/idverification/complete#complete-verification-request) ------------------------------------------------------------------------------------------------------------------- The complete verification request may contain an empty body (or empty JSON object). ### Request & Response[](https://apidocs.webshare.io/idverification/complete#request--response) POST https://proxy.webshare.io/api/v2/idverification/complete/ PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/idverification/complete/", json={}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "processing", "client_secret": null, "verification_failure_times": 0, "max_verification_failure_times": 0, "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00", "verified_at": null } [Start ID verification](https://apidocs.webshare.io/idverification/start "Start ID verification") [Sub-Users](https://apidocs.webshare.io/subuser "Sub-Users") --- # Start – Webshare API Docs [ID Verification](https://apidocs.webshare.io/idverification) Start ID verification Start verification[](https://apidocs.webshare.io/idverification/start#start-verification) ------------------------------------------------------------------------------------------ You should start a verification in order to receive the `client_secret`. In order to start a verification, the verification state has to be `requested` or `failed`. If the state is `failed`, you `verification_failure_times` must be less than `max_verification_failure_times`. When you start a verification successfully, the state will become `pending`. ### Start verification request[](https://apidocs.webshare.io/idverification/start#start-verification-request) The start verification request may contain an empty body (or empty JSON object). POST https://proxy.webshare.io/api/v2/idverification/start/ ### Request & Response[](https://apidocs.webshare.io/idverification/start#request--response) PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/idverification/start/", json={}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "pending", "client_secret": "aabbccc...zz", "verification_failure_times": 0, "max_verification_failure_times": 0, "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00", "verified_at": null } [Retrieve ID verification](https://apidocs.webshare.io/idverification/retrieve "Retrieve ID verification") [Complete ID verification](https://apidocs.webshare.io/idverification/complete "Complete ID verification") --- # View Suspension – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) View suspension View Suspension =============== This endpoint lets you view when your account was suspended and a reason for suspesnion. This endpoint can be called even if your user is suspended. ### Examples[](https://apidocs.webshare.io/verification/view_suspension#examples) GET https://proxy.webshare.io/api/v2/verification/suspension/ PythoncURL verification-suspension.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/verification/suspension/", headers={"Authorization": "Token APIKEY"} ) response.json() response.json { "created_at": "2022-06-14T11:58:10.246406-07:00", "reason": "acceptable_use_violation" } ### Possible reasons[](https://apidocs.webshare.io/verification/view_suspension#possible-reasons) | Reason | Description | | --- | --- | --- | | `acceptable_use_violation` | `The user has violated the acceptable use policy.` | | | `abuse_report` | `This user has been reported for abuse.` | | | `fraudulent_payment` | `This user has used fraudulent payments.` | | [Abuse reports](https://apidocs.webshare.io/verification/list_abuse_reports "Abuse reports") [ID Verification](https://apidocs.webshare.io/idverification "ID Verification") --- # ID Verification – Webshare API Docs ID Verification ID Verification =============== Your account may be required to complete ID verification in some cases (e.g. receiving affiliate payout). The ID verification can only be initiated if an account reached to this condition (e.g. minimum payout amount). Webshare uses [Stripe Identity (opens in a new tab)](https://stripe.com/identity) for ID Verification. You must use the [Stripe JS library (opens in a new tab)](https://stripe.com/docs/identity/verify-identity-documents) to complete the ID verification within the application. No ID documents are sent to the Webshare servers. The ID verification object[](https://apidocs.webshare.io/idverification#the-id-verification-object) ---------------------------------------------------------------------------------------------------- You can use the API to retrieve information about the ongoing ID verification ### Verification object[](https://apidocs.webshare.io/idverification#verification-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `number` | Unique identifier of this instance. | | `state` | `string` | State of the current ID verifiation. The verification states are listed below in further detail. | | `client_secret` | `string` | Client secret to be used with the [Stripe JS API](https://stripe.com/docs/identity/verify-identity-documents)
. May be `null` if the verification is not in the `pending` state. | | `verification_failure_times` | `number` | Number of times the ID verification has failed. | | `max_verification_failure_times` | `number` | Maximum number of times an ID verification can fail before the user cannot initiate a new ID verification. If set to 2, it means the user can try to verify their account 2 times. After the second failure, they won't be able to initiate ID verification any longer. | | `created_at` | `string` | The original registration date. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format. | | `updated_at` | `string` | The last time the verification object updated. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format. | | `verified_at` | `string` | Timestamp when the account has successfully completed the ID verification. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
format. May be `null`. | ### In JSON Format[](https://apidocs.webshare.io/idverification#in-json-format) { "id": 1, "state": "not-required", "client_secret": null, "verification_failure_times": 0, "max_verification_failure_times": 0, "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00", "verified_at": null } Verification state[](https://apidocs.webshare.io/idverification#verification-state) ------------------------------------------------------------------------------------ | Attributes | Type | Description | | --- | --- | --- | | `not-required` | `string` | The user is not required to complete ID verification. They may be required to complete ID verification when their payout threshold is met. | | `requested` | `string` | The user should start a verification. In this state, `client_secret` is null. | | `pending` | `string` | The user did initiate an ID verification. The user did not complete the ID verification yet on Stripe JS API. `client_secret` is set. | | `processing` | `string` | The user completed the ID verification. We are now processing the validity of the ID verification. `client_secret` is null. | | `failed` | `string` | The user has failed ID verification. The user may restart verification if `verification_failure_times` is less than `max_verification_failure_times`. | | `verified` | `string` | The user has completed ID verification successfully. | [View suspension](https://apidocs.webshare.io/verification/view_suspension "View suspension") [Retrieve ID verification](https://apidocs.webshare.io/idverification/retrieve "Retrieve ID verification") --- # Update API key – Webshare API Docs [API Keys](https://apidocs.webshare.io/apikeys) Update API key Update API key ============== This endpoint updates an API key ### Request & Response[](https://apidocs.webshare.io/apikeys/update#request--response) PATCH https://proxy.webshare.io/api/v2/apikey// PythonJavascriptcURL example.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/apikey//", json={ "label":"new label" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1337, "key": "abc1234...zzz", "label": "new label", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Create API key](https://apidocs.webshare.io/apikeys/create "Create API key") [Retrieve API key](https://apidocs.webshare.io/apikeys/retrieve "Retrieve API key") --- # Get ID Verification – Webshare API Docs [ID Verification](https://apidocs.webshare.io/idverification) Retrieve ID verification Get ID Verification =================== This endpoint retrieves the verification object. ### Request & Response[](https://apidocs.webshare.io/idverification/retrieve#request--response) GET https://proxy.webshare.io/api/v2/idverification/ PythonJavascriptcURL idverification.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/idverification/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "not-required", "client_secret": null, "verification_failure_times": 0, "max_verification_failure_times": 0, "created_at": "2019-05-09T23:34:00.095501-07:00", "updated_at": "2019-05-09T23:34:00.095501-07:00", "verified_at": null } [ID Verification](https://apidocs.webshare.io/idverification "ID Verification") [Start ID verification](https://apidocs.webshare.io/idverification/start "Start ID verification") --- # API Keys – Webshare API Docs API Keys API Keys ======== You can use the API keys to authorize your access. All API keys have the same permissions and full account access. The API key management endpoints cannot be called with an API key. They require a login token; calling them with an API key returns `403 Forbidden` with `{"detail": "Cannot query this API endpoint with an API key.", "code": "api_key_not_allowed"}`. ### API key object[](https://apidocs.webshare.io/apikeys#api-key-object) Each API key has the following fields | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | The unique ID of the API key. | | `key` | `string` | The 40 character alpha-numeric API key. | | `label` | `string` | The label for this API key. May be duplicate with other labels. | | `created_at` | `string` | The timestamp when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | ### In JSON Format[](https://apidocs.webshare.io/apikeys#in-json-format) { "id": 1337, "key": "abc1234...zzz", "label": "server1 key", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Reset download token](https://apidocs.webshare.io/downloads/reset_download_token "Reset download token") [Create API key](https://apidocs.webshare.io/apikeys/create "Create API key") --- # Allocate unallocated countries – Webshare API Docs [Proxy Configuration](https://apidocs.webshare.io/proxy-config) Assign unallocated countries Allocate unallocated countries ============================== This endpoint allocates the proxies in `unallocated_countries` state. If there are 5 unallocated countries, you must send `new_countries` with 5 countries in total. All `new_countries` must be valid and available. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. POST https://proxy.webshare.io/api/v2/proxy/config/allocate_unallocated_countries/ or in case of targeting a specific plan POST https://proxy.webshare.io/api/v2/proxy/config/allocate_unallocated_countries/?plan_id= ### Request & Response[](https://apidocs.webshare.io/proxy-config/allocate_unallocated_countries#request--response) PythonJavaScriptcURL allocate\_unallocated\_countries.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/proxy/config/allocate_unallocated_countries/", headers={"Authorization": "Token APIKEY"}, json={ "new_countries":{ "FR":5 } }, ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "completed", "countries": {"US": 5, "FR": 100}, "available_countries": {"US": 95}, "unallocated_countries": {}, "ip_ranges_24": {"10.1.1.0/24": 5, "10.1.3.0/24": 100}, "ip_ranges_16": {"10.1.0.0/16": 105}, "ip_ranges_8": {"10.0.0.0/8": 105}, "available_ip_ranges_24": {"1.2.3.0/24": 100}, "available_ip_ranges_16": {"1.2.0.0/16": 100}, "available_ip_ranges_8": {"1.0.0.0/8": 100}, "asns": {"6137": ["ASN NAME", 105]}, "available_asns": {"9421": ["ASN NAME", 105]}, "username": "username", "password": "password", "request_timeout": 86400, "request_idle_timeout": 900, "ip_authorization_country_codes": ["US", "FR"], "auto_replace_invalid_proxies": true, "auto_replace_low_country_confidence_proxies": false, "auto_replace_out_of_rotation_proxies": false, "auto_replace_failed_site_check_proxies": false, "proxy_list_download_token": "aa87abbc...zz", "is_proxy_used": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } ### HTTP request[](https://apidocs.webshare.io/proxy-config/allocate_unallocated_countries#http-request) `POST https://proxy.webshare.io/api/v2/proxy/config/allocate_unallocated_countries/` | Attributes | Description | | --- | --- | | new\_countries | Number of proxies by country\_code:count. Country code must be upper case and count must be greater than 0. | [Update proxy config](https://apidocs.webshare.io/proxy-config/update "Update proxy config") [IP Authorization](https://apidocs.webshare.io/ipauthorization "IP Authorization") --- # List stats – Webshare API Docs [Proxy Statistics](https://apidocs.webshare.io/proxystats) List statistics List stats ========== List the proxy stats within a time period. The stats are a aggregated hourly. Hours without proxy usage do not have a proxy stat object. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. This API endpoint _is not_ paginated. ### Parameters[](https://apidocs.webshare.io/proxystats/list_stats#parameters) | Parameter | Type | Description | | --- | --- | --- | | `timestamp__lte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be less than this. If given a date in the future, projected stats will be included for each hour between now and the given date. Cannot be after the `subscription.end_date`. Default is `subscription.end_date`. | | `timestamp__gte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be greater than this. Must be before the `timestamp__lte` field. Cannot be older than 90 days from today. Default is `subscription.start_date`. | ### Request & Response[](https://apidocs.webshare.io/proxystats/list_stats#request--response) GET https://proxy.webshare.io/api/v2/stats/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/stats/?plan_id= PythonJavascriptcURL list\_stats.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/stats/", { "timestamp__lte":"2022-09-09T23:34:00.095501-07:00", "timestamp__gte":"2022-08-09T23:34:00.095501-07:00" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json [\ {\ "timestamp": "2022-08-11T17:00:00-07:00",\ "is_projected": false,\ "bandwidth_total": 5000,\ "bandwidth_average": 1000,\ "requests_total": 5,\ "requests_successful": 4,\ "requests_failed": 1,\ "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ],\ "countries_used": {\ "GB": 1,\ "FR": 4\ },\ "number_of_proxies_used": 2,\ "protocols_used": {\ "http": 5\ },\ "average_concurrency": 0.0001388888888888889,\ "average_rps": 0.0002777777777777778,\ "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00"\ },\ ...\ ] [Proxy Statistics](https://apidocs.webshare.io/proxystats "Proxy Statistics") [Aggregate statistics](https://apidocs.webshare.io/proxystats/aggregate "Aggregate statistics") --- # Delete API key – Webshare API Docs [API Keys](https://apidocs.webshare.io/apikeys) Delete API key Delete API key ============== This endpoint lets you delete an API key. ### URL parameters[](https://apidocs.webshare.io/apikeys/delete#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `string` | The ID of the API key to delete. | ### Request & Response[](https://apidocs.webshare.io/apikeys/delete#request--response) DELETE https://proxy.webshare.io/api/v2/apikey// PythonJavascriptcURL example.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/apikey//", headers={"Authorization": "Token APIKEY"} ) response.json() The above command returns empty response with 204 HTTP status code HTTP/1.1 204 No Content [List API keys](https://apidocs.webshare.io/apikeys/list "List API keys") --- # Submit appeal – Webshare API Docs [Account Verification](https://apidocs.webshare.io/verification) Submit an appeal Submit appeal ============= This endpoint lets you submit an appeal for an account suspension. You can submit only one appeal at a time. ### Parameters[](https://apidocs.webshare.io/verification/submit_appeal#parameters) | Parameter | Type | Description | | --- | --- | --- | | `appeal` | `string` | The appeal you want to submit for an account suspension. | ### Examples[](https://apidocs.webshare.io/verification/submit_appeal#examples) PythonJavascriptcURL submit-appeal.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/verification/appeal/", json={ "appeal":"The appeal for account suspension you want to submit" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "appeal": "The appeal for account suspension you want to submit", "state": "submitted", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [List appeals](https://apidocs.webshare.io/verification/list_appeals "List appeals") [Abuse reports](https://apidocs.webshare.io/verification/list_abuse_reports "Abuse reports") --- # Available assets – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Available assets Available assets ================ This endpoint returns the available assets for each proxy category. ### Response[](https://apidocs.webshare.io/subscription/assets#response) | Field | Type | Description | | --- | --- | --- | | `total_subnets` | `number` | The number of subnets available under each proxy category. Categories are: `shared`, `semidedicated` and `dedicated`. And sub categories are: `default`, `isp`, `datacenter_and_isp` and `residential` | | `available_countries` | `dict` | Dictionary of [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
and the number of proxies we have in that country under each proxy category. | ### Request & Response[](https://apidocs.webshare.io/subscription/assets#request--response) GET https://proxy.webshare.io/api/v2/subscription/available_assets/ PythonJavascriptcURL available\_assets.py import requests import json response = requests.get( "https://proxy.webshare.io/api/v2/subscription/available_assets/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "shared": { "default": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}}, "residential": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}}, "isp": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}} }, "semidedicated": { "premium": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}}, "isp": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}} }, "dedicated": { "premium": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}}, "isp": {"total_subnets": 1, "available_countries": { "US": 1000, "CA": 1000, ...}} } } [Plan](https://apidocs.webshare.io/subscription/plan "Plan") [Customization options](https://apidocs.webshare.io/subscription/customize "Customization options") --- # Sub-Users – Webshare API Docs Sub-Users Sub-Users ========= Each sub-user can have separate limits and proxy list. The proxy list of the users you create are based on your main proxy list. You can make requests to [Proxy Configuration](https://apidocs.webshare.io/subuser#proxy-configuration) , [Proxy List](https://apidocs.webshare.io/subuser#proxy-list) and [Proxy Stats](https://apidocs.webshare.io/subuser#proxy-stats) APIs as a sub-user using the `X-Subuser` header. More [examples below](https://apidocs.webshare.io/subuser#masquerade-user) . This API is only available for after accepting additional terms for Webshare sub-user portal. If you wish to gain access to this API, please complete the form at [https://proxy.webshare.io/subuser/ (opens in a new tab)](https://proxy.webshare.io/subuser/) ### Sub-User object[](https://apidocs.webshare.io/subuser#sub-user-object) You can use the API to create, retrieve, update and delete each individual sub-user. | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | Unique identifier of the user. The ID never changes and no other user will receive the same ID. | | `label` | `string` | You can set label to identify your users. | | `proxy_countries` | `dict` | Can be set to `null` to disable custom proxy lists. Otherwise, dictionary of [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
and number of proxies. `ZZ` country code is special and means any available country. | | `proxy_limit` | `float` | The user proxy limit in GBs. You can set to 0 in order to get unlimited bandwidth. | | `max_thread_count` | `int` | The maximum number of proxy request concurrency this user can have. | | `aggregate_stats` | `dict` | Proxy stats for this sub-user, calculated over the account subscription billing period (see `stats_start_date` and `stats_end_date`). Follows the same format as the [Aggregate Stats](https://apidocs.webshare.io/subuser#aggregate-stats)
API. | | `stats_start_date` | `datetime` | Read-only field. Start of the period `aggregate_stats` are calculated over: the start of your current subscription billing period. The same period is used for every sub-user and for the account-level stats. | | `stats_end_date` | `datetime` | Read-only field. End of the period `aggregate_stats` are calculated over: the end of your current subscription billing period. | | `created_at` | `datetime` | Read-only field to indicate when this user was created. | | `updated_at` | `datetime` | Read-only field to indicate when this user was last updated. | | `bandwidth_use_start_date` | `datetime` | The time we start counting bandwidth use towards the sub-user `proxy_limit`. You can edit this field. Note: this limit cycle does not affect `aggregate_stats`, which always cover the subscription billing period. | | `bandwidth_use_end_date` | `datetime` | The time the sub-user bandwidth limit use will reset. Read-only field. | ### In JSON Format[](https://apidocs.webshare.io/subuser#in-json-format) { "id":7, "label":"Test User", "proxy_countries": { "ZZ":1000 }, "proxy_limit":10.0, "max_thread_count": 500, "aggregate_stats": { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" }, "created_at":"2019-06-09T23:34:00.095501-07:00", "updated_at":"2019-06-09T23:34:00.095517-07:00", "stats_start_date":"2019-06-01T00:00:00.000000-07:00", "stats_end_date":"2019-07-01T00:00:00.000000-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" } [Complete ID verification](https://apidocs.webshare.io/idverification/complete "Complete ID verification") [List sub-user](https://apidocs.webshare.io/subuser/list "List sub-user") --- # Masquerade as a user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Masquerade as a sub-user Masquerade as a user ==================== Add the `X-Subuser` header to your API calls to retrieve data as that particular sub-user. ### URL parameters[](https://apidocs.webshare.io/subuser/masquerade#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `Subuser ID` | `int` | The ID of the subuser you wish to masquerade as | ### Request & Response[](https://apidocs.webshare.io/subuser/masquerade#request--response) Add `X-Subuser` to any of the following APIs [Proxy Configuration](https://apidocs.webshare.io/subuser/masquerade#proxy-configuration) , [Proxy List](https://apidocs.webshare.io/subuser/masquerade#proxy-list) and [Proxy Stats](https://apidocs.webshare.io/subuser/masquerade#proxy-stats) PythonJavascriptcURL example.py import requests response = requests.get("https://proxy.webshare.io/api/v2/proxy/config/", headers={ "Authorization": "Token APIKEY", "X-Subuser": "" }) response.json() The commands above return JSON structured like this: response.json { "id": 1, "state": "completed", "countries": {"US":5, "FR":100}, "available_countries": {"US": 95}, "unallocated_countries": {}, "ip_ranges_24": {"10.1.1.0/24": 5, "10.1.3.0/24": 100}, "ip_ranges_16": {"10.1.0.0/16": 105}, "ip_ranges_8": {"10.0.0.0/24": 105}, "available_ip_ranges_24": {"1.2.3.0/24": 100}, "available_ip_ranges_16": {"1.2.3.0/24": 100}, "available_ip_ranges_8": {"1.2.3.0/24": 100}, "username": "username", "password": "password", "request_timeout": 86400, "request_idle_timeout": 900, "ip_authorization_country_codes": ["US", "FR"], "auto_replace_invalid_proxies": true, "auto_replace_low_country_confidence_proxies": false, "proxy_list_download_token": "aa87abbc...zz", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Refresh proxy list of a sub-user](https://apidocs.webshare.io/subuser/refresh_proxy_list "Refresh proxy list of a sub-user") [Get download token](https://apidocs.webshare.io/downloads/get_download_token "Get download token") --- # Delete a user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Delete sub-user Delete a user ============= This endpoint deletes a user. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### URL Parameters[](https://apidocs.webshare.io/subuser/delete#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the user to delete | ### Request & Response[](https://apidocs.webshare.io/subuser/delete#request--response) DELETE https://proxy.webshare.io/api/v2/subuser// or in case of targeting a specific plan DELETE https://proxy.webshare.io/api/v2/subuser//?plan_id= PythonJavascriptcURL example.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/subuser//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above returns empty response with `204 No Content` HTTP/1.1 204 No Content [Update sub-user](https://apidocs.webshare.io/subuser/update "Update sub-user") [Refresh proxy list of a sub-user](https://apidocs.webshare.io/subuser/refresh_proxy_list "Refresh proxy list of a sub-user") --- # Get API key – Webshare API Docs [API Keys](https://apidocs.webshare.io/apikeys) Retrieve API key Get API key =========== This endpoint lets you retrieve an API key. ### URL parameters[](https://apidocs.webshare.io/apikeys/retrieve#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `integer` | The ID of the API key to retrieve. | Request & Response[](https://apidocs.webshare.io/apikeys/retrieve#request--response) ------------------------------------------------------------------------------------- GET https://proxy.webshare.io/api/v2/apikey// PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/apikey//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1337, "key": "abc1234...zzz", "label": "server1 key", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Update API key](https://apidocs.webshare.io/apikeys/update "Update API key") [List API keys](https://apidocs.webshare.io/apikeys/list "List API keys") --- # List API keys – Webshare API Docs [API Keys](https://apidocs.webshare.io/apikeys) List API keys List API keys ============= This endpoint returns the API keys in [paginated](https://apidocs.webshare.io/#pagination) format. ### Request & Response[](https://apidocs.webshare.io/apikeys/list#request--response) GET https://proxy.webshare.io/api/v2/apikey/ PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/apikey/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1337,\ "key": "abc1234...zzz",\ "label": "server1 key",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ },\ ...\ ] } [Retrieve API key](https://apidocs.webshare.io/apikeys/retrieve "Retrieve API key") [Delete API key](https://apidocs.webshare.io/apikeys/delete "Delete API key") --- # Create API key – Webshare API Docs [API Keys](https://apidocs.webshare.io/apikeys) Create API key Create API key ============== This endpoint lets you create an API Key. To get the first API key, you should visit the [API Keys (opens in a new tab)](https://dashboard.webshare.io/userapi/keys) on your dashboard and then click on the "Create API Key" button. | Attributes | Type | Description | | --- | --- | --- | | `label` | `string` | The label to assign to this API key. May be duplicate with other labels. | ### Request & Response[](https://apidocs.webshare.io/apikeys/create#request--response) POST https://proxy.webshare.io/api/v2/apikey/ PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/apikey/", json={"label": "server1 key"}, headers={"Authorization": "Token APIKEY"}) response.json() The commands above return JSON structured like this: response.json { "id": 1337, "key": "abc1234...zzz", "label": "server1 key", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [API Keys](https://apidocs.webshare.io/apikeys "API Keys") [Update API key](https://apidocs.webshare.io/apikeys/update "Update API key") --- # Reset download token – Webshare API Docs Downloads Reset download token Reset download token ==================== This endpoint resets the download token that can be used to download different type of records. POST https://proxy.webshare.io/api/v2/download_token/activity/reset/ ### Parameters[](https://apidocs.webshare.io/downloads/reset_download_token#parameters) | Attributes | Type | Description | | --- | --- | --- | | `scope` | `string` | The scope of the token to be reset, the supported scopes are (proxy\_list, replaced\_proxy, activity) | ### Request & Response[](https://apidocs.webshare.io/downloads/reset_download_token#request--response) PythonJavaScriptcURL reset\_download\_token.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/download_token/activity/reset/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 56, "key": "abcdefghijklmnopqrstuvwxyz", "scope": "activity", "expire_at": "2022-06-14T11:58:10.246406-07:00" } [Get download token](https://apidocs.webshare.io/downloads/get_download_token "Get download token") [API Keys](https://apidocs.webshare.io/apikeys "API Keys") --- # Purchase a plan – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Purchase a plan Purchase a plan =============== You can use this API to purchase a new plan. A new plan will override your existing plan and update your `subscription.start_date`. The purchase API uses the same parameters as the [Subscription pricing](https://apidocs.webshare.io/subscription/pricing) endpoint with 3 additional fields: `behavior`, `payment_method` and `recaptcha`. This API endpoint requires recaptcha validation if a payment is required. If you have enough account credits, no payment is required. When a payment is required you should not be using this API endpoint programmatically and only use it from the Webshare Dashboard. ### Request fields[](https://apidocs.webshare.io/subscription/purchase_plan#request-fields) The purchase API uses the same parameters as the [Subscription pricing](https://apidocs.webshare.io/subscription/pricing) endpoint with 3 additional fields: `behavior`, `payment_method` and `recaptcha`. | Parameter | Type | Description | | --- | --- | --- | | `behavior` | `string` | Can be 2 options. 1) `replace`, (default value) the new purchased plan will replace the old one, this option is only supported for subscriptions with a single plan. 2) `add`, for adding the plan to the subscription. | | `payment_method` | `string` | Can be 3 unique options. 1) `null`, use the payment on file (same as `subscription.payment_method`). 2) Use an existing [PaymentMethod](https://apidocs.webshare.io/subscription/purchase_plan#payment-method)
id. 3) Add a new payment by using [Stripe PaymentMethod](https://stripe.com/docs/js/payment_methods)
ID (usually starts with "pm\_..."). | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Response fields[](https://apidocs.webshare.io/subscription/purchase_plan#response-fields) | Attributes | Type | Description | | --- | --- | --- | | `payment_required` | `boolean` | Whether a user needs to complete additional steps for the payment or not. If `false`, the purchase is completed and user now has the new plan. | | `plan` | `integer` | The ID of the new Plan object. | | `pending_payment` | `integer` | The ID of the PendingPayment instance. Only present if `payment_required == true`. | | `stripe_client_secret` | `string` | The `client_secret` for the Stripe [PaymentIntent](https://stripe.com/docs/js/payment_intents/confirm_card_payment)
. Only present if `payment_required == true`. | | `stripe_payment_intent` | `string` | The ID of the Stripe [PaymentIntent](https://stripe.com/docs/js/payment_intents/confirm_card_payment)
. Only present if `payment_required == true`. | | `stripe_payment_method` | `string` | The ID of the Stripe [PaymentMethod](https://stripe.com/docs/js/payment_methods/create_payment_method)
. Only present if `payment_required == true`. | ### Request & Response[](https://apidocs.webshare.io/subscription/purchase_plan#request--response) POST https://proxy.webshare.io/api/v2/subscription/checkout/purchase/ PythonJavascriptcURL purchase\_plan.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subscription/checkout/purchase/", json={ "proxy_type": "shared", "proxy_subtype": "default", "proxy_countries": {"US": 100}, "bandwidth_limit": 5000, "on_demand_refreshes_total": 0, "automatic_refresh_frequency": 0, "proxy_replacements_total": 0, "subusers_total": 3, "is_unlimited_ip_authorizations": False, "is_high_concurrency": False, "is_2x_concurrency": False, "is_high_priority_network": False, "high_quality_ips_only": False, "term": "monthly", "payment_method": 3, "recaptcha": "...", }, headers={"Authorization": "Token APIKEY"}, ) response.json() The commands above return JSON structured like this: response.json { "payment_required": true, "plan": 2, "pending_payment": 3, "stripe_client_secret": "...", "stripe_payment_intent": "...", "stripe_payment_method": "..." } [Pricing](https://apidocs.webshare.io/subscription/pricing "Pricing") [Renew the subscription](https://apidocs.webshare.io/subscription/renew "Renew the subscription") --- # Customization options – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Customization options Customization options ===================== This endpoint returns the limits/options available to customize for a plan. This endpoint JSON encodes the entire request in the `query` GET parameter. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. Make sure the GET parameters are also URL encoded (as required by the HTTP standards). ### Parameters[](https://apidocs.webshare.io/subscription/customize#parameters) | Parameter | Type | Description | | --- | --- | --- | | `proxy_type` | `string` | Category of proxies. Options are: `free`, `shared`, `semidedicated` and `dedicated`. | | `proxy_subtype` | `string` | Sub category of the proxies. Options are `default`, `premium`, `isp`, `residential` and `datacenter_and_isp`. Not all proxy types have the same sub types. | | `proxy_countries` | `object` | Number of proxies from each [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
. `ZZ` means country is randomly allocated. Other customizations are based on this field. | | `required_site_checks` | `list` | List of site checks the proxy list has to work with. E.g. `google_search` means that the proxies will work with Google search. | | `high_quality_ips_only` | `boolean` | Only use high quality IPs with perfect fraud scores. Not available for residential proxy plans. | ### Request & Response[](https://apidocs.webshare.io/subscription/customize#request--response) GET https://proxy.webshare.io/api/v2/subscription/customize/?query={json_encoded} or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/subscription/customize/?query={json_encoded}&plan_id= PythonJavascriptcURL customize\_options.py import requests import json response = requests.get( "https://proxy.webshare.io/api/v2/subscription/customize/", { "query": json.dumps( { "proxy_type": "shared", "proxy_subtype": "default", "proxy_countries": {"ZZ": 100}, } ) }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "proxy_type": "shared", "proxy_subtype": "default", "proxy_count_max": 60000, "proxy_count_min": 1, "available_countries": {"US": 45000, "GB": 5000, "FR": 10000}, "on_demand_refreshes_max": 1000, "on_demand_refreshes_min": 0, "automatic_refresh_frequency_max": 2592000, "automatic_refresh_frequency_min": 60, "proxy_replacements_max": 100000, "proxy_replacements_min": 0, "bandwidth_limit_max": 10000, "bandwidth_limit_min": 250, "subusers_max": 10000, "subusers_min": 3, "available_features": [\ {"feature": "is_unlimited_ip_authorizations"},\ {"feature": "is_high_concurrency"},\ {"feature": "is_2x_concurrency", "required": false},\ {"feature": "is_high_priority_network"}\ ], "available_site_checks": [\ {"name": "google_search_without_captcha"}\ ], "terms": [\ {"term": "monthly", "renewals_paid": 1},\ {"term": "yearly", "renewals_paid": 12}\ ] } [Available assets](https://apidocs.webshare.io/subscription/assets "Available assets") [Pricing](https://apidocs.webshare.io/subscription/pricing "Pricing") --- # Retention offer – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Retention offer Retention offer =============== Long-standing Rotating Residential customers who are about to cancel can accept a one-off retention offer: **20% off the Rotating Residential price on the next renewal**. The offer applies to a single renewal and can be accepted once per account. The [subscription object](https://apidocs.webshare.io/subscription) reports whether the offer can be accepted right now in the `retention_discount_resi_20_available` field. Check that flag before showing the offer; the endpoint below enforces the same rules server-side. Eligibility[](https://apidocs.webshare.io/subscription/retention_offer#eligibility) ------------------------------------------------------------------------------------ `retention_discount_resi_20_available` is `true` only when all of the following hold: * Auto-renewal is enabled on the subscription. * The subscription has exactly one active plan, and it is a Rotating Residential plan. * The offer has never been accepted on this account. It is a once-per-account offer, regardless of whether it was later redeemed or voided. * The Rotating Residential plan has been renewed at least twice, with no refunds since the plan was created. * No renewal or payment is currently in progress for the subscription. The flag reflects the state at the time of the request. It flips to `false` as soon as the offer is accepted, and it also becomes `false` while a renewal is being processed. How the discount is applied[](https://apidocs.webshare.io/subscription/retention_offer#how-the-discount-is-applied) -------------------------------------------------------------------------------------------------------------------- * The discount is applied automatically to the next renewal after acceptance. No further API call is required. * It is calculated on the Rotating Residential portion of the renewal price only. * It stacks on top of any coupon code or account promotion already applied to the renewal. The combined discount never exceeds the renewal price. * The rate is frozen at acceptance, so later changes to the offer do not affect an outstanding one. * If the Rotating Residential plan is cancelled before the renewal, the unredeemed offer is voided and cannot be accepted again. * If the discounted plan is cancelled after the renewal, the refund is calculated from the discounted amount that was actually paid. Accept the retention offer[](https://apidocs.webshare.io/subscription/retention_offer#accept-the-retention-offer) ------------------------------------------------------------------------------------------------------------------ Accepts the retention offer for the authenticated account. ### Request & Response[](https://apidocs.webshare.io/subscription/retention_offer#request--response) POST https://proxy.webshare.io/api/v2/subscription/retention_offer/ PythonJavascriptcURL accept\_retention\_offer.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subscription/retention_offer/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return a [subscription object](https://apidocs.webshare.io/subscription) with `retention_discount_resi_20_available` set to `false`, since the offer has now been accepted: response.json { "id": 1, "plan": 2, "payment_method": 1, "free_credits": 13.37, "term": "monthly", "start_date": "2022-06-14T11:19:14.489458-07:00", "end_date": "2022-07-14T11:19:14.489461-07:00", "renewals_paid": 2, "renewals_enabled": true, "failed_payment_times": 0, "account_discount_percentage": 0, "promotion_available_first_time_renewal_25_off": false, "customizable": true, "paused": false, "reactivation_date": null, "reactivation_period_left": null, "promo_type": null, "promo_value": null, "retention_discount_resi_20_available": false, "throttled": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } ### Error responses[](https://apidocs.webshare.io/subscription/retention_offer#error-responses) When the offer cannot be accepted, the endpoint returns a validation error of the form `[{"message": "", "code": ""}]`. | Error code | HTTP code | Description | | --- | --- | --- | | `retention_discount_not_available` | `400` | The subscription does not meet the [eligibility](https://apidocs.webshare.io/subscription/retention_offer#eligibility)
rules, or the offer was already accepted on this account: `The retention discount is not available for this subscription.` | [Auto-renewal](https://apidocs.webshare.io/subscription/auto_renewal "Auto-renewal") [Download invoice](https://apidocs.webshare.io/subscription/download_invoice "Download invoice") --- # Pending Payments – Webshare API Docs [Payments & Billing](https://apidocs.webshare.io/billing) Pending payments Pending Payments ================ Pending payments refer to payments that have been initiated but have not yet been processed or completed. This means that the payment has been authorized, but the funds have not yet been transferred from the payer's account to the payee's account. List pending payments[](https://apidocs.webshare.io/billing/pending_payments#list-pending-payments) ---------------------------------------------------------------------------------------------------- This endpoint retrieves all pending payments associated with the user in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. ### Request & Response[](https://apidocs.webshare.io/billing/pending_payments#request--response) GET https://proxy.webshare.io/api/v2/payment/pending/ PythonJavascriptcURL list\_pending\_payments.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/pending/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "status": "pending",\ "failure_reason": null,\ "payment_method": 2,\ "plan": 2,\ "transaction": null,\ "is_renewal": false,\ "term": "monthly",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "completed_at": null\ }\ ] } Get pending payment[](https://apidocs.webshare.io/billing/pending_payments#get-pending-payment) ------------------------------------------------------------------------------------------------ This endpoint returns the pending payment object. ### URL parameters[](https://apidocs.webshare.io/billing/pending_payments#url-parameters) | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | The ID of the pending payment to retrieve. | ### Request & Response[](https://apidocs.webshare.io/billing/pending_payments#request--response-1) GET https://proxy.webshare.io/api/v2/payment/pending// PythonJavascriptcURL get\_pending\_payment.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/pending/{ID}/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "status": "pending", "failure_reason": null, "payment_method": 2, "plan": 2, "transaction": null, "is_renewal": false, "term": "monthly", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "completed_at": null } [Billing information](https://apidocs.webshare.io/billing/billing "Billing information") [Update Payment Method](https://apidocs.webshare.io/billing/update_payment_method "Update Payment Method") --- # Get a user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Get sub-user Get a user ========== This endpoint retrieves a specific user. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### URL Parameters[](https://apidocs.webshare.io/subuser/retrieve#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the user to retrieve | ### Request & Response[](https://apidocs.webshare.io/subuser/retrieve#request--response) GET https://proxy.webshare.io/api/v2/subuser// or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/subuser//?plan_id= PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subuser//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id":7, "label":"Test User", "proxy_countries": { "ZZ":1000 }, "proxy_limit":10.0, "max_thread_count": 500, "aggregate_stats": { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" }, "created_at":"2019-06-09T23:34:00.095501-07:00", "updated_at":"2019-06-09T23:34:00.095517-07:00", "stats_start_date":"2019-06-01T00:00:00.000000-07:00", "stats_end_date":"2019-07-01T00:00:00.000000-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" } [List sub-user](https://apidocs.webshare.io/subuser/list "List sub-user") [Create sub-user](https://apidocs.webshare.io/subuser/create "Create sub-user") --- # Get download token – Webshare API Docs Downloads Get download token Get download token ================== This endpoint returns a download token that can be used to download different type of records. The `proxy_list` scope token is the same underlying token as the `proxy_list_download_token` field returned by the [Proxy Config](https://apidocs.webshare.io/proxy-config) API — you can retrieve it via either API and rotate it via the [Reset Download Token](https://apidocs.webshare.io/downloads/reset_download_token) API. GET https://proxy.webshare.io/api/v2/download_token/{scope}/ ### Parameters[](https://apidocs.webshare.io/downloads/get_download_token#parameters) | Attributes | Type | Description | | --- | --- | --- | | `scope` | `string` | The scope of the token according to the records need to be downloaded, the supported scopes are (proxy\_list, replaced\_proxy, activity) | ### Request & Response[](https://apidocs.webshare.io/downloads/get_download_token#request--response) PythonJavaScriptcURL get\_download\_token.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/download_token/activity/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 56, "key": "abcdefghijklmnopqrstuvwxyz", "scope": "activity", "expire_at": "2022-06-14T11:58:10.246406-07:00" } [Masquerade as a sub-user](https://apidocs.webshare.io/subuser/masquerade "Masquerade as a sub-user") [Reset download token](https://apidocs.webshare.io/downloads/reset_download_token "Reset download token") --- # Create a user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Create sub-user Create a user ============= Create a new user by setting label and bandwidth limit. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Request & Response[](https://apidocs.webshare.io/subuser/create#request--response) POST https://proxy.webshare.io/api/v2/subuser/ or in case of targeting a specific plan POST https://proxy.webshare.io/api/v2/subuser/?plan_id= PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subuser/", json={"label":"newcustomer", "proxy_limit": 10, "max_thread_count":500}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id":7, "label":"newcustomer", "proxy_countries": null, "proxy_limit":10.0, "max_thread_count": 500, "aggregate_stats": { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" }, "created_at":"2019-06-09T23:34:00.095501-07:00", "updated_at":"2019-06-09T23:34:00.095517-07:00", "stats_start_date":"2019-06-01T00:00:00.000000-07:00", "stats_end_date":"2019-07-01T00:00:00.000000-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" } [Get sub-user](https://apidocs.webshare.io/subuser/retrieve "Get sub-user") [Update sub-user](https://apidocs.webshare.io/subuser/update "Update sub-user") --- # Refresh proxy list of a user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Refresh proxy list of a sub-user Refresh proxy list of a user ============================ Refresh the proxy list of a user. You can only perform this action if the user has a custom proxy list. ### URL Parameters[](https://apidocs.webshare.io/subuser/refresh_proxy_list#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the user to refresh | ### Request & Response[](https://apidocs.webshare.io/subuser/refresh_proxy_list#request--response) POST https://proxy.webshare.io/api/v2/subuser//refresh/ PythonJavascriptcURL example.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subuser//refresh/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id":7, "label":"Test User", "proxy_countries": { "ZZ":1000 }, "proxy_limit":10.0, "max_thread_count": 500, "aggregate_stats": { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" }, "created_at":"2019-06-09T23:34:00.095501-07:00", "updated_at":"2019-06-09T23:34:00.095517-07:00", "stats_start_date":"2019-06-01T00:00:00.000000-07:00", "stats_end_date":"2019-07-01T00:00:00.000000-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" } [Delete sub-user](https://apidocs.webshare.io/subuser/delete "Delete sub-user") [Masquerade as a sub-user](https://apidocs.webshare.io/subuser/masquerade "Masquerade as a sub-user") --- # Update a Sub-user – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) Update sub-user Update a Sub-user ================= Update an existing user. You can partially update only the fields you wish to update. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### URL parameters[](https://apidocs.webshare.io/subuser/update#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `id` | `integer` | The ID of the user | | `label` | `string` | The label of the user | ### Request & Response[](https://apidocs.webshare.io/subuser/update#request--response) PATCH https://proxy.webshare.io/api/v2/subuser// or in case of targeting a specific plan PATCH https://proxy.webshare.io/api/v2/subuser//?plan_id= PythonJavascriptcURL example.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/subuser//", json={"label":"newlabel"}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id":7, "label":"newlabel", "proxy_countries": { "ZZ":1000 }, "proxy_limit":10.0, "max_thread_count": 500, "aggregate_stats": { "bandwidth_projected": 100000, "bandwidth_total": 5000, "bandwidth_average": 1000, "requests_total": 5, "requests_successful": 4, "requests_failed": 1, "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ], "countries_used": { "GB": 1, "FR": 4 }, "number_of_proxies_used": 2, "protocols_used": { "http": 5 }, "average_concurrency": 0.0001388888888888889, "average_rps": 0.0002777777777777778, "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00" }, "created_at":"2019-06-09T23:34:00.095501-07:00", "updated_at":"2019-06-09T23:34:00.095517-07:00", "stats_start_date":"2019-06-01T00:00:00.000000-07:00", "stats_end_date":"2019-07-01T00:00:00.000000-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" } [Create sub-user](https://apidocs.webshare.io/subuser/create "Create sub-user") [Delete sub-user](https://apidocs.webshare.io/subuser/delete "Delete sub-user") --- # List proxy activity – Webshare API Docs [Proxy Statistics](https://apidocs.webshare.io/proxystats) List proxy activities List proxy activity =================== List the proxy activity within a time period. You can paginate this endpoint using the `starting_after` and `page_size` fields instead of the `page` field. You can pass the `timestamp` of the latest activity instance to the `starting_after` queryset to view the next page. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### Parameters[](https://apidocs.webshare.io/proxystats/list_activity#parameters) | Parameter | Type | Description | | --- | --- | --- | | `timestamp__lte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be less than this. If given a date in the future, projected stats will be included for each hour between now and the given date. Cannot be after the `subscription.end_date`. Default is now. | | `timestamp__gte` | `string` | The [timestamp](https://en.wikipedia.org/wiki/ISO_8601)
of the stats will be greater than this. Must be before the `timestamp__lte` field. Cannot be older than 90 days from today. Default is six days ago. | | `search` | `string` | Generic search query. | | `error_reason` | `string` | Match only requests with the given error\_reason. You can pass `*` to filter for only requests with an error. | | `starting_after` | `string` | You can pass the timestamp of the last proxy activity to retrieve the next page. | | `bytes__gte` | `string` | Filter requests with bytes equal or greater than the given value. | | `bytes__lte` | `string` | Filter requests with bytes equal or less than the given value. | | `verification_category` | `string` | The account verification category to filter with. | ### Request & Response[](https://apidocs.webshare.io/proxystats/list_activity#request--response) GET https://proxy.webshare.io/api/v2/proxy/activity/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/proxy/activity/?plan_id= PythonJavascriptcURL list\_activity.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/proxy/activity/", { "timestamp__lte":"2022-09-09T23:34:00.095501-07:00", "timestamp__gte":"2022-08-09T23:34:00.095501-07:00" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 10, "next": null, "previous": null, "results": [\ {\ "timestamp": "2022-08-16T15:29:42.517523-07:00",\ "protocol": "http",\ "request_duration": 0.5,\ "handshake_duration": 0.3,\ "tunnel_duration": 0.2,\ "error_reason": "client_connect_forbidden_host",\ "error_reason_how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "auth_username": null,\ "proxy_address": "192.168.5.1",\ "bytes": 0,\ "client_address": "10.1.0.1",\ "ip_address": "10.1.0.2",\ "hostname": "ipv4.webshare.io",\ "domain": "webshare.io",\ "port": 443,\ "proxy_port": null,\ "listen_address": "192.168.5.24",\ "listen_port": 6455\ },\ ...\ ] } [Activity object](https://apidocs.webshare.io/proxystats/activity_object "Activity object") [Download proxy activities](https://apidocs.webshare.io/proxystats/download_activity "Download proxy activities") --- # Referral Channels – Webshare API Docs [Referral & Affiliate](https://apidocs.webshare.io/referral) Referral Channels Referral Channels ================= A referral channel is a coupon code that you own and can share with other users. When another user applies the channel's `code` and makes a paid purchase, they receive the configured discount and you accrue a [referral credit](https://apidocs.webshare.io/referral/referral_credit) for the commission. Each channel can be configured for one-time-only discounts (first purchase only) or recurring discounts (every renewal). Channels are created and configured by the Webshare team. This endpoint lists the channels that belong to the authenticated user along with aggregate usage statistics. The referral channel object[](https://apidocs.webshare.io/referral/referral_channel#the-referral-channel-object) ----------------------------------------------------------------------------------------------------------------- | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the referral channel. | | `code` | `string` | The coupon code other users apply to receive the discount. Case-insensitive when matched. | | `description` | `string` | Human-readable description of the channel. May be an empty string. | | `promo_type` | `string` | Type of discount. Either `percent_off` or `value_off`. | | `promo_value` | `decimal` | Magnitude of the discount. For `percent_off` this is a value between 0 and 1 (e.g. `0.20` for 20% off). For `value_off` this is an absolute USD amount. | | `is_active` | `boolean` | If `false`, the code can no longer be applied by new users. | | `is_recurring` | `boolean` | If `true`, the discount applies to every renewal of the redeemer's plan. If `false`, only to the first purchase. | | `start_date` | `datetime` | Timestamp from which the code becomes applicable. | | `end_date` | `datetime` | Timestamp after which the code can no longer be applied. May be `null` if the channel does not expire. | | `total_uses` | `integer` | Total number of distinct redemptions of this channel across all users. | | `total_commission` | `float` | Total USD commission earned through this channel. | | `total_revenue` | `float` | Total USD revenue generated by redeemers of this channel — sum of paid transaction amounts (net of refunds) across all redemptions. Uses the same attribution rule as `total_uses`: transactions from users referred via a different affiliate's link are excluded. | | `initial_rate` | `decimal` | Commission rate (0 to 1) applied to a referred user's transactions during the initial period. E.g. `0.25` means 25% commission. | | `ongoing_rate` | `decimal` | Commission rate (0 to 1) applied to a referred user's transactions after the initial period. | | `initial_rate_period_days` | `integer` | Length, in days, of the initial commission period. After this many days from a user's first transaction, `ongoing_rate` is applied instead of `initial_rate`. | | `max_earnings_per_referred` | `decimal` | Maximum USD commission that can be earned from a single referred user across the lifetime of the channel. | | `created_at` | `datetime` | Timestamp of when the channel was created. | ### In JSON format[](https://apidocs.webshare.io/referral/referral_channel#in-json-format) referral\_channel.json { "id": 1, "code": "SUMMER20", "description": "20% off the first purchase", "promo_type": "percent_off", "promo_value": "0.20", "is_active": true, "is_recurring": false, "start_date": "2026-01-01T00:00:00-08:00", "end_date": null, "total_uses": 42, "total_commission": 128.50, "total_revenue": 612.40, "initial_rate": "0.25", "ongoing_rate": "0.10", "initial_rate_period_days": 30, "max_earnings_per_referred": "1000.00", "created_at": "2025-12-15T11:58:10.246406-08:00" } List referral channels[](https://apidocs.webshare.io/referral/referral_channel#list-referral-channels) ------------------------------------------------------------------------------------------------------- Returns the referral channels owned by the authenticated user. The response is an array ordered by `id` ascending; the endpoint is **not** paginated. ### Request & Response[](https://apidocs.webshare.io/referral/referral_channel#request--response) GET https://proxy.webshare.io/api/v2/referral/channel/ PythonJavascriptcURL list\_referral\_channels.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/channel/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json [\ {\ "id": 1,\ "code": "SUMMER20",\ "description": "20% off the first purchase",\ "promo_type": "percent_off",\ "promo_value": "0.20",\ "is_active": true,\ "is_recurring": false,\ "start_date": "2026-01-01T00:00:00-08:00",\ "end_date": null,\ "total_uses": 42,\ "total_commission": 128.50,\ "total_revenue": 612.40,\ "initial_rate": "0.25",\ "ongoing_rate": "0.10",\ "initial_rate_period_days": 30,\ "max_earnings_per_referred": "1000.00",\ "created_at": "2025-12-15T11:58:10.246406-08:00"\ }\ ] [Earn out](https://apidocs.webshare.io/referral/referral_earnout "Earn out") [Coupon Code](https://apidocs.webshare.io/referral/coupon_code "Coupon Code") --- # List users – Webshare API Docs [Sub-Users](https://apidocs.webshare.io/subuser) List sub-user List users ========== This endpoint retrieves all users in the system. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. ### URL parameters[](https://apidocs.webshare.io/subuser/list#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `page` | `int` | Page number | ### Request & Response[](https://apidocs.webshare.io/subuser/list#request--response) GET https://proxy.webshare.io/api/v2/subuser/ or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/subuser/?plan_id= PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subuser/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count":1, "next":null, "previous":null, "results":[\ {\ "id":7,\ "label":"Test User",\ "proxy_countries": {\ "ZZ":1000\ },\ "proxy_limit":10.0,\ "max_thread_count": 500,\ "aggregate_stats": {\ "bandwidth_projected": 100000,\ "bandwidth_total": 5000,\ "bandwidth_average": 1000,\ "requests_total": 5,\ "requests_successful": 4,\ "requests_failed": 1,\ "error_reasons": [\ {\ "reason": "client_connect_forbidden_host",\ "type": "configuration",\ "how_to_fix": "The target website you are connecting cannot be accessed via Webshare Proxy.",\ "http_status": 403,\ "count": 1\ }\ ],\ "countries_used": {\ "GB": 1,\ "FR": 4\ },\ "number_of_proxies_used": 2,\ "protocols_used": {\ "http": 5\ },\ "average_concurrency": 0.0001388888888888889,\ "average_rps": 0.0002777777777777778,\ "last_request_sent_at": "2022-08-11T17:12:32.589667-07:00"\ },\ "created_at":"2019-06-09T23:34:00.095501-07:00",\ "updated_at":"2019-06-09T23:34:00.095517-07:00",\ "stats_start_date":"2019-06-01T00:00:00.000000-07:00",\ "stats_end_date":"2019-07-01T00:00:00.000000-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"\ }\ ] } [Sub-Users](https://apidocs.webshare.io/subuser "Sub-Users") [Get sub-user](https://apidocs.webshare.io/subuser/retrieve "Get sub-user") --- # Billing Information – Webshare API Docs [Payments & Billing](https://apidocs.webshare.io/billing) Billing information Billing Information =================== Billing Info Object[](https://apidocs.webshare.io/billing/billing#billing-info-object) --------------------------------------------------------------------------------------- | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the billing information instance. | | `name` | `string` | Name for the invoices. Will appear on invoices. Can be a company name. Default is empty string. | | `address` | `string` | Address for the invoices. Will appear on invoices. Can be a corporate address. Default is empty string. | | `billing_email` | `string` | Email address for the invoices. Will appear on invoices. Default is empty string. | | `created_at` | `string` | Timestamp on when the account was created | | `updated_at` | `string` | The timestamp when this instance was last updated. | **In JSON format** billing\_information\_object.json { "id": 1, "name": "Webshare Software", "address": "Lemon Ave", "billing_email": "incomingbills@webshare.io", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Get billing information[](https://apidocs.webshare.io/billing/billing#get-billing-information) ----------------------------------------------------------------------------------------------- This endpoint returns the billing information object associated with the account. There is only 1 billing information associated with each account. ### Request & Response[](https://apidocs.webshare.io/billing/billing#request--response) GET https://proxy.webshare.io/api/v2/subscription/billing_info/ PythonJavascriptcURL get\_billing\_information.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subscription/billing_info/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "name": "Webshare Software", "address": "Lemon Ave", "billing_email": "incomingbills@webshare.io", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Update billing information[](https://apidocs.webshare.io/billing/billing#update-billing-information) ----------------------------------------------------------------------------------------------------- This endpoint updates the billing information. ### Request & Response[](https://apidocs.webshare.io/billing/billing#request--response-1) PATCH https://proxy.webshare.io/api/v2/subscription/billing_info/ PythonJavascriptcURL update\_billing\_information.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/subscription/billing_info/", json={ "name":"New Billing Name" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "name": "New Billing Name", "address": "Lemon Ave", "billing_email": "incomingbills@webshare.io", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-15T11:58:10.246406-07:00" } [Transactions](https://apidocs.webshare.io/billing/transactions "Transactions") [Pending payments](https://apidocs.webshare.io/billing/pending_payments "Pending payments") --- # List transactions – Webshare API Docs [Payments & Billing](https://apidocs.webshare.io/billing) Transactions List transactions ================= This endpoint retrieves all transactions associated with the user in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. ### Request & Response[](https://apidocs.webshare.io/billing/transactions#request--response) GET https://proxy.webshare.io/api/v2/payment/transaction/ PythonJavascriptcURL list\_transactions.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/transaction/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "status": "completed",\ "payment_method": {\ "id": 1,\ "brand": "visa",\ "last4": "4242",\ "name": null,\ "expiration_year": 2023,\ "expiration_month": 6,\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ },\ "reason": "Upgraded from Free Plan to 100 Proxies with 250 GB bandwidth.",\ "amount": 1.0,\ "credits_used": 0.0,\ "credits_gained": 0.0,\ "refund_amount": 0.0,\ "refund_date": null,\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ }\ ] } Get transaction[](https://apidocs.webshare.io/billing/transactions#get-transaction) ------------------------------------------------------------------------------------ This endpoint retrieves the transaction by ID. ### URL parameters[](https://apidocs.webshare.io/billing/transactions#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `integer` | The ID of the transaction to retrieve | ### Request & Response[](https://apidocs.webshare.io/billing/transactions#request--response-1) GET https://proxy.webshare.io/api/v2/payment/transaction// PythonJavascriptcURL get\_transaction.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/transaction/1/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "status": "completed", "payment_method": { "id": 1, "brand": "visa", "last4": "4242", "name": null, "expiration_year": 2023, "expiration_month": 6, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" }, "reason": "Upgraded from Free Plan to 100 Proxies with 250 GB bandwidth.", "amount": 1.0, "credits_used": 0.0, "credits_gained": 0.0, "refund_amount": 0.0, "refund_date": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Payment methods](https://apidocs.webshare.io/billing/payment_methods "Payment methods") [Billing information](https://apidocs.webshare.io/billing/billing "Billing information") --- # Referral Earn out – Webshare API Docs [Referral & Affiliate](https://apidocs.webshare.io/referral) Earn out Referral Earn out ================= ### The earn out object[](https://apidocs.webshare.io/referral/referral_earnout#the-earn-out-object) Whenever a user is rewarded credits/payouts from their pending balance (e.g. `ReferralConfig.credits_earned`), an earn out instance is created. | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | Unique identifier of the earn out instance. | | `mode` | `str` | Indicates whether the earn out is a `payout` or `credit`. | | `paypal_payout_email` | `str` | If mode is `payout`, indicates the PayPal email which received the funds. | | `amount` | `float` | Amount earned out in USD. | | `status` | `str` | Status can be `processing`, `completed` or `failed`. | | `error_reason` | `str` | If status is set to `failed`, show what the error is. Otherwise, set to `null`. | | `created_at` | `str` | The timestamp of when this instance was created. | | `updated_at` | `str` | The timestamp when this instance was last updated. | ### In JSON format[](https://apidocs.webshare.io/referral/referral_earnout#in-json-format) earnout.json { "id": 1, "mode": "credits", "paypal_payout_email": null, "amount": 2.50, "status": "completed", "error_reason": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } List earn outs[](https://apidocs.webshare.io/referral/referral_earnout#list-earn-outs) --------------------------------------------------------------------------------------- This endpoint returns the earn outs in [paginated](https://apidocs.webshare.io/#pagination) format. ### Request & Response[](https://apidocs.webshare.io/referral/referral_earnout#request--response) GET https://proxy.webshare.io/api/v2/referral/earnout/ PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/earnout/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "mode": "credits",\ "paypal_payout_email": null,\ "amount": 2.50,\ "status": "completed",\ "error_reason": null,\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ },\ ...\ ] } Retrieve earn out[](https://apidocs.webshare.io/referral/referral_earnout#retrieve-earn-out) --------------------------------------------------------------------------------------------- This endpoint lets you retrieve an earn out. ### Parameters[](https://apidocs.webshare.io/referral/referral_earnout#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the earn out object to retrieve. | ### Request & Response[](https://apidocs.webshare.io/referral/referral_earnout#request--response-1) GET https://proxy.webshare.io/api/v2/referral/earnout/{ID}/ PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/earnout/{ID}/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "mode": "credits", "paypal_payout_email": null, "amount": 2.50, "status": "completed", "error_reason": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Credits](https://apidocs.webshare.io/referral/referral_credit "Credits") [Referral Channels](https://apidocs.webshare.io/referral/referral_channel "Referral Channels") --- # Subscription – Webshare API Docs Subscription Subscription ============ ⚠️ **Important distinction between Subscription and Plan** Subscription stays with the user even after a user switches to a new Plan. Whereas, a new Plan object is created each time a customer re-customizes their Plan. Each Webshare account has 1 subscription and 1 active plan associated with it. There may be multiple in-active plans. Subscription object holds general information about the user subscription e.g. start/end dates. [See the Plan API](https://apidocs.webshare.io/subscription/plan) . Subscription Object[](https://apidocs.webshare.io/subscription#subscription-object) ------------------------------------------------------------------------------------ | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | Unique identifier of the subscription instance. This ID should not change for the user | | `plan` | `int` | Unique identifier of the active plan instance. This ID will change whenever a user re-customizes their plan | | `payment_method` | `int` | Unique identifier of the payment method | | `free_credits` | `float` | Free credits available in for the account in USD | | `term` | `string` | Used to determine the amount to charge in the next renewal. Can be `monthly` or `yearly`. | | `start_date` | `string` | The start date of the current renewal term. The difference between end/start dates are always 30 days even in yearly subscriptions. | | `end_date` | `string` | The end date of the current renewal term. The difference between end/start dates are always 30 days even in yearly subscriptions. | | `renewals_paid` | `int` | Number of 30 day increment renewals paid. `yearly` terms pay for 12 renewals at once while `monthly` terms pay for 1 renewal at a time. | | `renewals_enabled` | `bool` | Whether auto-renewal is enabled or not. When disabled, the subscription will not be automatically renewed at the end of the current term. | | `failed_payment_times` | `int` | Number of times an automated renewal payment failed. | | `account_discount_percentage` | `int` | Discount percentage for the account. | | `promotion_available_first_time_renewal_25_off` | `bool` | Whether the 25% off for renewals is available. | | `customizable` | `bool` | Whether the subscription is customizable or not, usually VIP accounts are not customizable because their plans are customized by the customer support team directly. | | `paused` | `bool` | Whether the subscription is paused or not. | | `reactivation_date` | `string` | The time stamp when the subscription will be unpaused and resumed | | `reactivation_period_left` | `string` | The period left in the subscription when the subscription has been paused. | | `promo_type` | `string` | The type of promotion this account will receive. May be `first_time_value_off`, `first_time_percent_off`, `always_value_off` or `always_percent_off`. May be set to `null`. | | `promo_value` | `integer` | The value of the promotion this account will receive. May be `10` or `20`. May be set to `null` if `promo_type` is `null`. | | `retention_discount_resi_20_available` | `bool` | Whether the one-off 20% [retention offer](https://apidocs.webshare.io/subscription/retention_offer)
on the next Rotating Residential renewal can be accepted right now. Always `false` once the offer has been accepted. | | `throttled` | `bool` | Whether the subscription is throttled or not. Mostly throttling is due to high bandwidth usage with low number of proxies. | | `created_at` | `string` | The timestamp of when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | ### In JSON format[](https://apidocs.webshare.io/subscription#in-json-format) { "id": 1, "plan": 2, "payment_method": 1, "free_credits": 13.37, "term": "monthly", "start_date": "2022-06-14T11:19:14.489458-07:00", "end_date": "2022-07-14T11:19:14.489461-07:00", "renewals_paid": 0, "renewals_enabled": true, "failed_payment_times": 0, "account_discount_percentage": 0, "promotion_available_first_time_renewal_25_off": false, "customizable": true, "paused": false, "reactivation_date": null, "reactivation_period_left": null, "promo_type": null, "promo_value": null, "retention_discount_resi_20_available": false, "throttled": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Get Subscription[](https://apidocs.webshare.io/subscription#get-subscription) ------------------------------------------------------------------------------ This endpoint returns the subscription object associated with the account. There is only 1 subscription associated with each account. GET https://proxy.webshare.io/api/v2/subscription/ ### Requests & Response[](https://apidocs.webshare.io/subscription#requests--response) PythonJavascriptcURL get\_subscription.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subscription/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "plan": 2, "payment_method": 1, "free_credits": 13.37, "term": "monthly", "start_date": "2022-06-14T11:19:14.489458-07:00", "end_date": "2022-07-14T11:19:14.489461-07:00", "renewals_paid": 0, "renewals_enabled": true, "failed_payment_times": 0, "account_discount_percentage": 0, "promotion_available_first_time_renewal_25_off": false, "customizable": true, "paused": false, "reactivation_date": null, "reactivation_period_left": null, "promo_type": null, "promo_value": null, "retention_discount_resi_20_available": false, "throttled": false, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } [Download proxy activities](https://apidocs.webshare.io/proxystats/download_activity "Download proxy activities") [Plan](https://apidocs.webshare.io/subscription/plan "Plan") --- # Payments & Billing – Webshare API Docs Payments & Billing Payments & Billing ================== Webshare has 2 main objects for managing payment & billing: * [Payment Method](https://apidocs.webshare.io/billing#payment-method) : The payment method used in the payment process. * [Transaction](https://apidocs.webshare.io/billing#transaction) : The transaction created when a payment is completed. Payment Method[](https://apidocs.webshare.io/billing#payment-method) --------------------------------------------------------------------- The payment method used in the payment process. There are various payment methods (e.g. card, Stripe Link). All of the payment methods can be accessed via the same API. You can distinguish payment methods using the `type` field. All payment methods ### Payment method object[](https://apidocs.webshare.io/billing#payment-method-object) #### Shared fields for payment methods[](https://apidocs.webshare.io/billing#shared-fields-for-payment-methods) All payment methods have the following shared fields. Each payment method may have additional fields. | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the payment method instance. | | `type` | `string` | Unique identifier of the payment type. Example values: StripeCard, LinkPayment | | `created_at` | `string` | The timestamp of when the payment method was created. | | `updated_at` | `string` | The timestamp of when the payment method was last updated. | | `line` | `string` | Billing address line. | | `city` | `string` | Billing address city. | | `postal_code` | `string` | Billing address postal code. | | `state` | `string` | Billing address state. | | `country` | `string` | Billing address country. | #### Fields for `StripeCard`[](https://apidocs.webshare.io/billing#fields-for-stripecard) The fields below are available only when the PaymentMethod.type is `StripeCard`. | Attributes | Type | Description | | --- | --- | --- | | `brand` | `string` | Brand of the card. Could be `mastercard`, `amex`, `visa`, `diners club`, `jcb` or \`unionpay | | `last4` | `string` | Last 4 digits of the card. | | `expiration_year` | `number` | Expiration year of the card. | | `expiration_month` | `number` | Expiration month of the card. `6` means June. | **In JSON format** stripe\_card.json { "id": 1, "type": "StripeCard", "brand": "visa", "last4": "4242", "name": null, "expiration_year": 2023, "expiration_month": 6, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "line": "123 George Street", "city": "Sydney", "state": null, "postal_code": "2000", "country": "AU" } #### Fields for `LinkPayment`[](https://apidocs.webshare.io/billing#fields-for-linkpayment) Link payments do not have any additional fields. link\_payment.json { "id": 1, "type": "LinkPayment", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Transaction[](https://apidocs.webshare.io/billing#transaction) --------------------------------------------------------------- The transaction created when a payment is completed. ### Transaction object[](https://apidocs.webshare.io/billing#transaction-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the transaction instance. | | `status` | `string` | Status of the object. Can be `completed` or `refunded`. Partial refunds will show up as `refunded`. | | `payment_method` | `object` | Nested payment method instance. | | `reason` | `string` | The reason of this transaction. | | `amount` | `number` | The amount of the transaction in USD. | | `credits_used` | `number` | The credits used in the transaction. | | `credits_gained` | `number` | The credits gained in the transaction (In case of downgrading). | | `refund_amount` | `number` | The amount refunded in USD. | | `refund_date` | `string` | The date the last refund was issued. May be `null` if no refund was issued. If a user is refunded multiple times for the same transaction, only the last date will be shown. | | `created_at` | `string` | The timestamp of when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | **In JSON format** transaction\_object.json { "id": 1, "status": "completed", "payment_method": { "id": 1, "brand": "visa", "last4": "4242", "name": null, "expiration_year": 2023, "expiration_month": 6, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" }, "reason": "Upgraded from Free Plan to 100 Proxies with 250 GB bandwidth.", "amount": 1.0, "credits_used": 0.0, "credits_gained": 0.0, "refund_amount": 0.0, "refund_date": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Pending Payments[](https://apidocs.webshare.io/billing#pending-payments) ------------------------------------------------------------------------- ### Pending payment object[](https://apidocs.webshare.io/billing#pending-payment-object) | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the pending payment object. | | `status` | `string` | Current state of the pending payment. Can be `pending`, `processing`, `successful` or `failed`. | | `failure_reason` | `string` | Set to a user-friendly string if a status is `failed`. Default is null. | | `payment_method` | `object` | Nested payment method instance. | | `plan` | `object` | Nested plan instance. | | `transaction` | `object` | Nested transaction instance. Only set if the status is `successful`. | | `is_renewal` | `boolean` | Whether the payment should be used to renew the subscription or immediately change it. | | `term` | `string` | Term of the payment. Can be `monthly` or `yearly`. | | `created_at` | `string` | The timestamp on when the pending payment was created | | `updated_at` | `string` | The timestamp when the pending payment was last updated. | | `completed_at` | `string` | The timestamp when the pending payment was completed. May be `null` if the payment is not completed yet. | **In JSON format** pending\_payment\_object.json { "id": 1, "status": "pending", "failure_reason": null, "payment_method": 2, "plan": 2, "transaction": null, "is_renewal": false, "term": "monthly", "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "completed_at": null } [Download invoice](https://apidocs.webshare.io/subscription/download_invoice "Download invoice") [Payment methods](https://apidocs.webshare.io/billing/payment_methods "Payment methods") --- # Referral Credits – Webshare API Docs [Referral & Affiliate](https://apidocs.webshare.io/referral) Credits Referral Credits ================ ### The referral credit object[](https://apidocs.webshare.io/referral/referral_credit#the-referral-credit-object) Each time a referral spends money on Webshare, the user may earn referral credits. Each credit is tracked by the referral credit object. | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the referral credit instance. | | `user_id` | `integer` | Unique identifier of the referred user who spent money on Webshare. | | `mode` | `string` | Indicates whether the referral credit is in `payout` or `credit` mode. This mode cannot be changed. | | `amount` | `decimal` | Amount earned in USD. | | `status` | `string` | Status can be `pending`, `available` or `reverted`. A credit becomes available after `ReferralConfig.referral_payment_pending_days` period. | | `referral_channel` | `integer` | ID of the [referral channel](https://apidocs.webshare.io/referral/referral_channel)
(coupon code) that produced this credit. `null` for credits earned through a referral link rather than a coupon code. | | `referral_channel_code` | `string` | Code of the referral channel that produced this credit. `null` for credits earned through a referral link rather than a coupon code. | | `created_at` | `datetime` | The timestamp of when this instance was created. | | `updated_at` | `datetime` | The timestamp when this instance was last updated. | | `reverted_at` | `datetime` | The timestamp when this credit was reverted. Is `null` if the status is not `reverted`. | ### In JSON format[](https://apidocs.webshare.io/referral/referral_credit#in-json-format) referral\_credit.json { "id": 1, "user_id": 6124, "mode": "credits", "amount": 2.50, "status": "pending", "referral_channel": null, "referral_channel_code": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "reverted_at": null } List referral credits[](https://apidocs.webshare.io/referral/referral_credit#list-referral-credits) ---------------------------------------------------------------------------------------------------- This endpoint returns the referral credits in [paginated](https://apidocs.webshare.io/#pagination) format. ### Filters[](https://apidocs.webshare.io/referral/referral_credit#filters) | Parameter | Type | Description | | --- | --- | --- | | `mode` | `string` | Filter by `payout` or `credits`. | | `status` | `string` | Filter by `pending`, `available` or `reverted`. | | `referral_channel` | `integer` | Filter by the ID of a [referral channel](https://apidocs.webshare.io/referral/referral_channel)
you own. Pass an empty value to match credits with no associated channel. | Results can also be ordered with the `ordering` parameter. Supported fields are `id`, `mode`, `amount`, `status`, `created_at`, `updated_at` and `reverted_at`. Prefix with `-` for descending order, e.g. `?ordering=-created_at`. ### Request & Response[](https://apidocs.webshare.io/referral/referral_credit#request--response) GET https://proxy.webshare.io/api/v2/referral/credit/ PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/credit/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "user_id": 6124,\ "mode": "credits",\ "amount": 2.50,\ "status": "pending",\ "referral_channel": 1,\ "referral_channel_code": "SUMMER20",\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "reverted_at": null\ },\ ...\ ] } Get referral credit[](https://apidocs.webshare.io/referral/referral_credit#get-referral-credit) ------------------------------------------------------------------------------------------------ This endpoint lets you retrieve a referral credit. | Parameter | Type | Description | | --- | --- | --- | | `ID` | `integer` | Unique identifier of the referral credit instance. | ### Request & Response[](https://apidocs.webshare.io/referral/referral_credit#request--response-1) GET https://proxy.webshare.io/api/v2/referral/credit// PythonJavascriptcURL example.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/credit/{ID}/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "user_id": 6124, "mode": "credits", "amount": 2.50, "status": "pending", "referral_channel": null, "referral_channel_code": null, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "reverted_at": null } [Referral & Affiliate](https://apidocs.webshare.io/referral "Referral & Affiliate") [Earn out](https://apidocs.webshare.io/referral/referral_earnout "Earn out") --- # Pricing – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Pricing Pricing ======= This endpoint returns the pricing for a custom plan. This endpoint JSON encodes the entire request in the `query` GET parameter. You can add a query-string parameter `plan_id` in case you want to target a specific plan otherwise it will use the default plan. Make sure the GET parameters are also URL encoded (as required by the HTTP standards). ### Parameters[](https://apidocs.webshare.io/subscription/pricing#parameters) JSON encode all the parameters below into the `query` GET query. | Parameter | Type | Description | | --- | --- | --- | | `behavior` | `string` | Can be 3 options. 1) `replace`, (default value) the new purchased plan will replace the old one, this option is only supported for subscriptions with a single plan. 2) `add`, for adding the plan to the subscription. 3) `upgrade`, for upgrading the plan. | | `proxy_type` | `string` | Category of proxies. Options are: `free`, `shared`, `semidedicated` and `dedicated`. | | `proxy_subtype` | `string` | Sub category of the proxies. Options are `default`, `premium`, `isp`, `residential` and `datacenter_and_isp`. Not all proxy types have the same sub types. | | `proxy_countries` | `object` | Number of proxies from each [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
. `ZZ` means country is randomly allocated. | | `bandwidth_limit` | `number` | Bandwidth limit in GBs. `0` means unlimited bandwidth. | | `on_demand_refreshes_total` | `number` | Number of on-demand refreshes purchased as part of this plan. | | `automatic_refresh_frequency` | `number` | Auto-refresh your proxy list every `automatic_refresh_frequency` seconds. `0` value means no automatic refreshes. | | `proxy_replacements_total` | `number` | Individual proxy replacements purchased as part of this plan. | | `subusers_total` | `number` | Number of subusers allowed in this plan. | | `is_unlimited_ip_authorizations` | `boolean` | Indicates if unlimited number of IP Authorizations can be created. If set to `false`, only 1 IP Authorization ca be created for each account. | | `is_high_concurrency` | `boolean` | Indicates whether high proxy concurrency is enabled for the account. | | `is_2x_concurrency` | `boolean` | Indicates whether 2x concurrency (1,000 concurrent requests) is enabled for the account. | | `is_high_priority_network` | `boolean` | Indicates whether high proxy priority is enabled for the account. | | `high_quality_ips_only` | `boolean` | Only use high quality IPs with perfect fraud scores. Not available for residential proxy plans. Applies a 30% price premium. | | `term` | `string` | Used to determine the amount to charge in the next renewal. Can be `monthly` or `yearly`. | | `required_site_checks` | `array` | List of required site checks so proxies won’t be blocked on these websites. | | `with_tax` | `boolean` | Include tax information (Optional, default false) | ### Request & Response[](https://apidocs.webshare.io/subscription/pricing#request--response) GET https://proxy.webshare.io/api/v2/subscription/pricing/?query={json_encoded} or in case of targeting a specific plan GET https://proxy.webshare.io/api/v2/subscription/pricing/?query={json_encoded}&plan_id= PythonJavascriptcURL get\_pricing.py import requests import json response = requests.get( "https://proxy.webshare.io/api/v2/subscription/pricing/", { "query": json.dumps( { "proxy_type": "shared", "proxy_subtype": "default", "proxy_countries": {"US": 100}, "bandwidth_limit": 5000, "on_demand_refreshes_total": 0, "automatic_refresh_frequency": 0, "proxy_replacements_total": 0, "subusers_total": 3, "term": "monthly", "is_unlimited_ip_authorizations": False, "is_high_concurrency": False, "is_2x_concurrency": False, "is_high_priority_network": False, "high_quality_ips_only": False, "with_tax": True, } ) }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "discount_percentage": 10, "non_discounted_price": 15.49, "price": 13.94, "paid_today": 8.94, "credits_added": 0, "credits_used": 5, "promo_discount": 0.0, "proxy_count_discount_tiers": [\ {\ "from": 0,\ "to": 250,\ "discount_percentage": 0,\ "per_proxy_price": 0.0299\ },\ {\ "from": 250,\ "to": 500,\ "discount_percentage": 5,\ "per_proxy_price": 0.028405\ },\ {\ "from": 500,\ "to": 1000,\ "discount_percentage": 10,\ "per_proxy_price": 0.02691\ },\ {\ "from": 1000,\ "to": 2500,\ "discount_percentage": 15,\ "per_proxy_price": 0.025415\ },\ {\ "from": 2500,\ "to": 5000,\ "discount_percentage": 20,\ "per_proxy_price": 0.02392\ },\ {\ "from": 5000,\ "to": 10000,\ "discount_percentage": 25,\ "per_proxy_price": 0.022425\ },\ {\ "from": 10000,\ "to": 25000,\ "discount_percentage": 30,\ "per_proxy_price": 0.020929999999999997\ },\ {\ "from": 25000,\ "to": null,\ "discount_percentage": 35,\ "per_proxy_price": 0.019435\ }\ ], "bandwidth_discount_tiers": [\ {\ "from": 0,\ "to": 250,\ "per_gb_price": 0.0149\ },\ {\ "from": 250,\ "to": 1000,\ "per_gb_price": 0.0068\ },\ {\ "from": 1000,\ "to": 5000,\ "per_gb_price": 0.0039\ },\ {\ "from": 5000,\ "to": null,\ "per_gb_price": null\ }\ ], "features": [\ {\ "feature": "is_unlimited_ip_authorizations",\ "is_selected": true,\ "price": 10\ },\ {\ "feature": "is_high_concurrency",\ "is_selected": false,\ "price": 55\ },\ {\ "feature": "is_2x_concurrency",\ "is_selected": false,\ "price": 0\ },\ {\ "feature": "is_high_priority_network",\ "is_selected": false,\ "price": 15\ }\ ], "tax_breakdown": [\ {\ "amount": "0.54",\ "tax_rate_details":\ {\ "percentage_decimal": "10.00",\ "tax_type": "gst"\ },\ "taxable_amount": "5.40"\ }\ ], "coupon_discount": { "code": "SUMMER20", "promo_type": "percent_off", "promo_value": "0.20", "is_recurring": false } } ### Response fields[](https://apidocs.webshare.io/subscription/pricing#response-fields) | Attributes | Type | Description | | --- | --- | --- | | `discount_percentage` | `integer` | Percentage of discount applied to the final price. | | `non_discounted_price` | `float` | Original price for the term before any discounts are applied. | | `price` | `float` | The price after discounts are applied. | | `paid_today` | `float` | The amount which needs to be paid today. Credits are applied to this price. | | `promo_discount` | `float` | USD value of the promo discount applied to `price`. Reflects the [applied coupon code](https://apidocs.webshare.io/referral/coupon_code)
when one is active; otherwise reflects any referral-based promo on the subscription. | | `credits_added` | `float` | Amount of credits added to the plan to make this subscription change. If changing from $50 plan to $100 plan, this field will be $50 (minus any deductions). | | `credits_used` | `float` | The total credits used to change the subscription. | | `proxy_count_discount_tiers` | `list` | List of discount percentages and per\_proxy\_price. From is exclusive; to is inclusive. E.g. 250 proxies have 0% discount, 251 proxies have 5% discount. If `to` is set to `null`, include up to infinity. | | `bandwidth_discount_tiers` | `list` | List of per\_gb\_price. From is exclusive; to is inclusive. E.g. 250 GB has price $0.0149, 251 GB has price $0.0068. If `to` is set to `null`, include up to infinity. | | `features` | `list` | List of features and their prices. | | `tax_breakdown` | `list` | List of tax entries if with\_tax was true | | `coupon_discount` | `object` | Summary of the [coupon code](https://apidocs.webshare.io/referral/coupon_code)
currently applied to the authenticated user, or `null` when no code is applied. Contains `code`, `promo_type`, `promo_value` and `is_recurring` — see [Coupon Code](https://apidocs.webshare.io/referral/coupon_code)
for field semantics. | [Customization options](https://apidocs.webshare.io/subscription/customize "Customization options") [Purchase a plan](https://apidocs.webshare.io/subscription/purchase_plan "Purchase a plan") --- # Payment Methods – Webshare API Docs [Payments & Billing](https://apidocs.webshare.io/billing) Payment methods Payment Methods =============== List payment methods[](https://apidocs.webshare.io/billing/payment_methods#list-payment-methods) ------------------------------------------------------------------------------------------------- This endpoint retrieves all payment methods associated with the user in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. ### Request & Response[](https://apidocs.webshare.io/billing/payment_methods#request--response) GET https://proxy.webshare.io/api/v2/payment/method/ PythonJavascriptcURL list\_payment\_methods.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/method/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count": 1, "next": null, "previous": null, "results": [\ {\ "id": 1,\ "type": "StripeCard",\ "brand": "visa",\ "last4": "4242",\ "name": null,\ "expiration_year": 2023,\ "expiration_month": 6,\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00",\ "line": "123 George Street",\ "city": "Sydney",\ "state": null,\ "postal_code": "2000",\ "country": "AU"\ }\ ] } Get payment method[](https://apidocs.webshare.io/billing/payment_methods#get-payment-method) --------------------------------------------------------------------------------------------- This endpoint retrieves the payment method by ID. You can find the active payment method id from the subscription object. ### URL parameters[](https://apidocs.webshare.io/billing/payment_methods#url-parameters) | Parameter | Type | Description | | --- | --- | --- | | `id` | `integer` | The ID of the payment method to retrieve | ### Request & Response[](https://apidocs.webshare.io/billing/payment_methods#request--response-1) GET https://proxy.webshare.io/api/v2/payment/method/1/ PythonJavascriptcURL get\_payment\_methods.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/payment/method/1/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "type": "StripeCard", "brand": "visa", "last4": "4242", "name": null, "expiration_year": 2023, "expiration_month": 6, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00", "line": "123 George Street", "city": "Sydney", "state": null, "postal_code": "2000", "country": "AU" } Remove payment method[](https://apidocs.webshare.io/billing/payment_methods#remove-payment-method) --------------------------------------------------------------------------------------------------- Remove the card currently saved on the subscription. The endpoint takes no ID: it always removes the card attached to the subscription, and `DELETE` on a specific payment method is not supported. If no card is saved, the request succeeds and nothing changes. ### Request & Response[](https://apidocs.webshare.io/billing/payment_methods#request--response-2) DELETE https://proxy.webshare.io/api/v2/payment/method/ PythonJavascriptcURL remove\_payment\_method.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/payment/method/", headers={"Authorization": "Token APIKEY"} ) Returns `204 No Content` on success with an empty body. ### Error responses[](https://apidocs.webshare.io/billing/payment_methods#error-responses) When the card cannot be removed, the endpoint returns a validation error of the form `[{"message": "", "code": ""}]`. | Error code | HTTP code | Description | | --- | --- | --- | | `paid_plan_active` | `400` | The subscription has a paid plan: `Cannot remove the payment method while a paid plan is active. Cancel auto-renewal instead.` Cancel [auto-renewal](https://apidocs.webshare.io/subscription/auto_renewal)
first, which removes the card as part of the cancellation. | [Payments & Billing](https://apidocs.webshare.io/billing "Payments & Billing") [Transactions](https://apidocs.webshare.io/billing/transactions "Transactions") --- # Referral & Affiliate – Webshare API Docs Referral & Affiliate Referral & Affiliate ==================== You can earn credits or payouts directly to your PayPal account by referring users to Webshare. Switching to affiliate program via the API indicates your consent for the additional affiliate agreement [https://www.webshare.io/affiliate-agreement (opens in a new tab)](https://www.webshare.io/affiliate-agreement) . Referral Config Object[](https://apidocs.webshare.io/referral#referral-config-object) -------------------------------------------------------------------------------------- Referral config object indicates the current state of the referral system. | Attributes | Type | Description | | --- | --- | --- | | `id` | `integer` | Unique identifier of the referral config instance. This ID should not change for the user. | | `mode` | `string` | Indicates whether the system is in payout or credits mode. Possible options are `payout` and `credits`. In payout mode, user can receive earn-out to their PayPal account. | | `paypal_payout_email` | `string` | May be null if mode is `credits`. Must be set if the mode is `payout`. | | `id_verification_required` | `boolean` | After an account is eligible for a payout, they must complete ID verification. ID verification is not required until payout conditions are met. | | `credits_earned` | `number` | Amount of USD earned and pending to be converted to account credits. These credits will be converted to `Subscription.free_credits` at the time of the next earn-out. This field will be set to 0 afterwards. | | `payouts_earned` | `number` | Amount of USD earned and pending to be earned out to PayPal account. These payouts will be sent to a PayPal account at the time of the next earn-out. This field will be set to 0 afterwards. | | `total_credits_earned` | `number` | Total amount of credits earned so far. | | `total_payouts_earned` | `number` | Total amount of payouts earned so far. | | `number_of_users_referred` | `number` | Number of unique users referred. | | `number_of_users_upgraded` | `number` | Number of unique users who upgraded. | | `earn_out_frequency` | `string` | Frequency of earn-outs. Format is \[DD\] \[HH:MM:SS\]. | | `next_earn_out_date` | `string` | Timestamp of the next earn-out. At this time the credits\_earned and payouts\_earned will be converted to account credits or sent to PayPal. | | `minimum_earn_out_amount` | `number` | Minimum USD need to be earned for the earn-out to be processed. For example, if `credits_earned` is $5.00 and minimum\_earn\_out\_amount is $10.00, no earn-out will be processed. | | `referral_code` | `string` | Unique referral code of this user. User can navigate to any Webshare public page with `referral_code={referral_code}` GET query to set the referral code. | | `promo_type` | `string` | The type of promotion referrals will receive. May be `first_time_value_off`, `first_time_percent_off`, `always_value_off` or `always_percent_off`. May be set to `null`. | | `promo_value` | `integer` | The value of the promotion referrals will receive. May be `10` or `20`. May be set to `null` if `promo_type` is `null`. | | `referral_url` | `string` | Example referral URL to the Webshare home page. | | `referral_maximum_credits` | `number` | Maximum amount of credits/payouts can be earned from a single referral. | | `referral_credit_ratio` | `number` | Ratio of credits/payouts earned from a referral purchase. For example, if `referral_credit_ratio=0.25`, and referral spends $100, user will earn $25. | | `referral_payment_pending_days` | `string` | Grace period for a referral credit/payouts to become available. During the pending period, if the payment is reversed, the credits will be reversed too. Format is \[DD\] \[HH:MM:SS\]. | | `created_at` | `string` | The timestamp of when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | Get Referral Config[](https://apidocs.webshare.io/referral#get-referral-config) -------------------------------------------------------------------------------- Retrieve a referral config. ### Request & Response[](https://apidocs.webshare.io/referral#request--response) GET https://proxy.webshare.io/api/v2/referral/config/ PythonJavascriptcURL get\_referral\_object.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/config/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "mode": "payout", "paypal_payout_email": "paypal@webshare.io", "id_verification_required": false, "credits_earned": 0.0, "payouts_earned": 0.0, "total_credits_earned": 0.0, "total_payouts_earned": 0.0, "number_of_users_referred": 0, "number_of_users_upgraded": 0, "earn_out_frequency": "7 00:00:00", "next_earn_out_date": "2022-06-14T11:58:10.246406-07:00", "minimum_earn_out_amount": 10, "referral_code": "78saf89712", "referral_url": "https://www.webshare.io/?referral_code=78saf89712", "referral_maximum_credits": 100, "referral_credit_ratio": 0.25, "referral_payment_pending_days": "30 00:00:00", "promo_type": "first_time_value_off", "promo_value": 10, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-15T11:58:10.246406-07:00" } Update Referral Config[](https://apidocs.webshare.io/referral#update-referral-config) -------------------------------------------------------------------------------------- This endpoint updates the referral config. The only writable fields are `mode` and `paypal_payout_email`. ### Request & Response[](https://apidocs.webshare.io/referral#request--response-1) PATCH https://proxy.webshare.io/api/v2/referral/config/ PythonJavascriptcURL update\_referral\_object.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/referral/config/", json={ "mode":"payout", "paypal_payout_email": "paypal@webshare.io" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 1, "mode": "payout", "paypal_payout_email": "paypal@webshare.io", "id_verification_required": false, "credits_earned": 0.0, "payouts_earned": 0.0, "total_credits_earned": 0.0, "total_payouts_earned": 0.0, "number_of_users_referred": 0, "number_of_users_upgraded": 0, "earn_out_frequency": "7 00:00:00", "next_earn_out_date": "2022-06-14T11:58:10.246406-07:00", "minimum_earn_out_amount": 10, "referral_code": "78saf89712", "referral_url": "https://www.webshare.io/?referral_code=78saf89712", "referral_maximum_credits": 100, "referral_credit_ratio": 0.25, "referral_payment_pending_days": "30 00:00:00", "promo_type": "first_time_value_off", "promo_value": 10, "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-15T11:58:10.246406-07:00" } [Update Payment Method](https://apidocs.webshare.io/billing/update_payment_method "Update Payment Method") [Credits](https://apidocs.webshare.io/referral/referral_credit "Credits") --- # Coupon Code – Webshare API Docs [Referral & Affiliate](https://apidocs.webshare.io/referral) Coupon Code Coupon Code =========== A coupon code is a referral channel code that the authenticated user can apply to their account in order to receive a discount on their subscription. Codes are created by referrers (see [Referral Channels](https://apidocs.webshare.io/referral/referral_channel) ); other users redeem them through the endpoints on this page. At most one coupon code can be in the `applied` state per user at a time. Applying a new code replaces the previously applied code. Once an applied code is consumed by a paid transaction it moves to the `redeemed` state and can no longer be applied by the same user. The applied coupon code object[](https://apidocs.webshare.io/referral/coupon_code#the-applied-coupon-code-object) ------------------------------------------------------------------------------------------------------------------ | Attributes | Type | Description | | --- | --- | --- | | `code` | `string` | The coupon code as configured on the referral channel. `null` when no code is applied. | | `promo_type` | `string` | Type of promotion. May be `percent_off` or `value_off`. `null` when no code is applied. | | `promo_value` | `decimal` | Magnitude of the promotion. For `percent_off` this is a value between 0 and 1 (e.g. `0.20` for 20% off). For `value_off` this is an absolute USD amount. `null` when no code is applied. | | `description` | `string` | Human-readable description configured on the channel. May be an empty string. `null` when no code is applied. | | `is_recurring` | `boolean` | If `true`, the discount applies to every renewal while the code remains applied. If `false`, it only applies to the first purchase. `null` when no code is applied. | ### In JSON format[](https://apidocs.webshare.io/referral/coupon_code#in-json-format) coupon\_code.json { "code": "SUMMER20", "promo_type": "percent_off", "promo_value": "0.20", "description": "20% off the first purchase", "is_recurring": false } When no code is applied, every field is `null`: coupon\_code\_empty.json { "code": null, "promo_type": null, "promo_value": null, "description": null, "is_recurring": null } Get applied coupon code[](https://apidocs.webshare.io/referral/coupon_code#get-applied-coupon-code) ---------------------------------------------------------------------------------------------------- Retrieve the coupon code currently applied to the authenticated user, or an empty object if no code is applied. ### Request & Response[](https://apidocs.webshare.io/referral/coupon_code#request--response) GET https://proxy.webshare.io/api/v2/referral/coupon-code/ PythonJavascriptcURL get\_applied\_coupon.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/referral/coupon-code/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "code": "SUMMER20", "promo_type": "percent_off", "promo_value": "0.20", "description": "20% off the first purchase", "is_recurring": false } Apply a coupon code[](https://apidocs.webshare.io/referral/coupon_code#apply-a-coupon-code) -------------------------------------------------------------------------------------------- Apply a coupon code to the authenticated user. If a code is already applied to the account, it is replaced by the newly submitted one. This endpoint is rate-limited to **5 requests per minute** per user. ### Parameters[](https://apidocs.webshare.io/referral/coupon_code#parameters) | Parameter | Type | Description | | --- | --- | --- | | `code` | `string` | The coupon code to apply. Maximum 100 characters. Matching is case-insensitive and surrounding whitespace is trimmed. | ### Request & Response[](https://apidocs.webshare.io/referral/coupon_code#request--response-1) POST https://proxy.webshare.io/api/v2/referral/coupon-code/ PythonJavascriptcURL apply\_coupon.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/referral/coupon-code/", json={"code": "SUMMER20"}, headers={"Authorization": "Token APIKEY"} ) response.json() On success, the response is the [applied coupon code object](https://apidocs.webshare.io/referral/coupon_code#the-applied-coupon-code-object) : response.json { "code": "SUMMER20", "promo_type": "percent_off", "promo_value": "0.20", "description": "20% off the first purchase", "is_recurring": false } ### Error responses[](https://apidocs.webshare.io/referral/coupon_code#error-responses) When the code cannot be applied, the endpoint returns `400 Bad Request` with a validation error of the form `{"code": [{"message": "", "code": ""}]}`. The error `code` reflects which check failed and can be used to render a localized message client-side. | Error code | Message | Description | | --- | --- | --- | | `not_found` | `Invalid promo code.` | No matching active referral channel exists, or the channel's `start_date` is in the future. | | `code_inactive` | `This code is no longer active.` | The referral channel has been deactivated by its owner. | | `code_expired` | `This code has expired.` | The referral channel's `end_date` is in the past. | | `self_referral` | `You cannot use your own referral code.` | You attempted to apply a coupon code that you own. | | `already_redeemed` | `You have already redeemed this code.` | You have already used this code on a previous paid transaction. | Remove the applied coupon code[](https://apidocs.webshare.io/referral/coupon_code#remove-the-applied-coupon-code) ------------------------------------------------------------------------------------------------------------------ Remove the coupon code currently applied to the authenticated user. Already-redeemed codes are not affected. ### Request & Response[](https://apidocs.webshare.io/referral/coupon_code#request--response-2) DELETE https://proxy.webshare.io/api/v2/referral/coupon-code/ PythonJavascriptcURL remove\_coupon.py import requests response = requests.delete( "https://proxy.webshare.io/api/v2/referral/coupon-code/", headers={"Authorization": "Token APIKEY"} ) Returns `204 No Content` on success with an empty body. [Referral Channels](https://apidocs.webshare.io/referral/referral_channel "Referral Channels") [Referral Info (Public)](https://apidocs.webshare.io/referral/referral_info "Referral Info (Public)") --- # Plans – Webshare API Docs [Subscription](https://apidocs.webshare.io/subscription) Plan Plans ===== ⚠️ **Important distinction between Subscription and Plan** Subscription stays with the user even after a user switches to a new Plan. Whereas, a new Plan object is created each time a customer re-customizes their Plan. Plan object holds information about the customization options for the plan e.g. plan type, monthly price, proxy locations. [See the Subscription API](https://apidocs.webshare.io/subscription) . Plan Object[](https://apidocs.webshare.io/subscription/plan#plan-object) ------------------------------------------------------------------------- | Attributes | Type | Description | | --- | --- | --- | | `id` | `int` | Unique identifier of the plan instance. | | `status` | `string` | Plan status. Options are: `active` or `cancelled`. | | `bandwidth_limit` | `float` | Bandwidth limit in GBs. `0` means unlimited bandwidth. | | `monthly_price` | `float` | Price in USD for the monthly term. | | `yearly_price` | `float` | Price in USD for the yearly term. | | `proxy_type` | `string` | Category of proxies. Options are: `free`, `shared`, `semidedicated` and `dedicated`. | | `proxy_subtype` | `string` | Sub category of the proxies. Options are `default`, `premium`, `isp`, `residential` and `datacenter_and_isp`. Not all proxy types have the same sub types. | | `proxy_count` | `int` | Number of proxies in the plan. | | `proxy_countries` | `object` | Number of proxies from each [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
. `ZZ` means country is randomly allocated. | | `required_site_checks` | `list` | List of site checks the proxy list has to work with. E.g. `google_search` means that the proxies will work with Google search. | | `on_demand_refreshes_total` | `int` | Number of on-demand refreshes purchased as part of this plan. | | `on_demand_refreshes_used` | `int` | Number of on-demand refreshes used since subscription.start\_date. The on-demand refreshes reset at the end of subscription.end\_date. | | `on_demand_refreshes_available` | `int` | Number of on-demand refreshes available for this plan. | | `automatic_refresh_frequency` | `int` | Auto-refresh your proxy list every `automatic_refresh_frequency` seconds. `0` value means no automatic refreshes. | | `automatic_refresh_last_at` | `datetime` | Last time proxy list was auto-refreshed. It will come as `null` in the case of the list plans endpoint. | | `automatic_refresh_next_at` | `datetime` | Next time proxy list will be auto-refreshed. It will come as `null` in the case of the list plans endpoint. | | `proxy_replacements_total` | `int` | Individual proxy replacements purchased as part of this plan. | | `proxy_replacements_used` | `int` | Individual proxy replacements used since subscription.start\_date. The proxy replacements reset at the end of subscription.end\_date. | | `proxy_replacements_available` | `int` | Individual proxy replacements available for this plan. | | `subusers_total` | `int` | Number of subusers allowed in this plan. | | `subusers_used` | `int` | Number of subusers used in this plan. | | `subusers_available` | `int` | Number of subusers available in this plan. | | `is_unlimited_ip_authorizations` | `boolean` | Indicates whether this plan has unlimited IP Authorizations. | | `is_high_concurrency` | `boolean` | Indicates whether this plan has high concurrency (3,000 concurrent requests). | | `is_2x_concurrency` | `boolean` | Indicates whether this plan has 2x concurrency (1,000 concurrent requests). When enabled, the plan is not treated as High Concurrency. | | `is_high_priority_network` | `boolean` | Indicates whether this plan has high priority network. | | `high_quality_ips_only` | `boolean` | Indicates whether this plan only uses high quality IPs with perfect fraud scores. Not available for residential proxy plans. Applies a 30% price premium. | | `bundle_info` | `object` | Set when this plan is an addon in a bundle. Contains `primary_plan_id` (the ID of the bundle's primary plan, can be `null`) and `discount_rate` (the discount applied to this plan, e.g. `0.2` for 20%). `null` if the plan is not a bundle addon. | | `bundle_addons` | `list` | Set when this plan is the primary plan of a bundle. Each entry contains `plan_id` (the ID of the addon plan) and `discount_rate` (the discount applied to that addon). Empty list if the plan has no bundle addons. | | `created_at` | `string` | The timestamp when this instance was created. | | `updated_at` | `string` | The timestamp when this instance was last updated. | ### In JSON format[](https://apidocs.webshare.io/subscription/plan#in-json-format) { "id": 2, "status": "active", "bandwidth_limit": 50.0, "monthly_price": 9.99, "yearly_price": 49.99, "proxy_type": "shared", "proxy_subtype": "default", "proxy_count": 1000, "proxy_countries": {"ZZ": 1000}, "required_site_checks": ["google_search"], "on_demand_refreshes_total": 0, "on_demand_refreshes_used": 0, "on_demand_refreshes_available": 0, "automatic_refresh_frequency": 0, "automatic_refresh_last_at": null, "automatic_refresh_next_at": null, "proxy_replacements_total": 10, "proxy_replacements_used": 0, "proxy_replacements_available": 10, "subusers_total": 3, "subusers_used": 0, "subusers_available": 3, "is_unlimited_ip_authorizations": true, "is_high_concurrency": true, "is_2x_concurrency": false, "is_high_priority_network": false, "high_quality_ips_only": false, "bundle_info": { "primary_plan_id": 1, "discount_rate": 0.2 }, "bundle_addons": [\ {\ "plan_id": 3,\ "discount_rate": 0.2\ }\ ], "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } List plans[](https://apidocs.webshare.io/subscription/plan#list-plans) ----------------------------------------------------------------------- This endpoint retrieves all plans created by the user (even the non-active ones) in [paginated](https://apidocs.webshare.io/#pagination) format with [filtering & ordering](https://apidocs.webshare.io/#filtering-amp-ordering) enabled. GET https://proxy.webshare.io/api/v2/subscription/plan/ ### Request & Response[](https://apidocs.webshare.io/subscription/plan#request--response) PythonJavascriptcURL list\_plans.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subscription/plan/", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "count":1, "next":null, "previous":null, "results":[\ {\ "id": 2,\ "status": "active",\ "bandwidth_limit": 50.0,\ "monthly_price": 9.99,\ "yearly_price": 49.99,\ "proxy_type": "shared",\ "proxy_subtype": "default",\ "proxy_count": 1000,\ "proxy_countries": {"ZZ": 1000},\ "required_site_checks": ["google_search"],\ "on_demand_refreshes_total": 0,\ "on_demand_refreshes_used": 0,\ "on_demand_refreshes_available": 0,\ "automatic_refresh_frequency": 0,\ "automatic_refresh_last_at": null,\ "automatic_refresh_next_at": null,\ "proxy_replacements_total": 10,\ "proxy_replacements_used": 0,\ "proxy_replacements_available": 10,\ "subusers_total": 3,\ "subusers_used": 0,\ "subusers_available": 3,\ "is_unlimited_ip_authorizations": true,\ "is_high_concurrency": true,\ "is_2x_concurrency": false,\ "is_high_priority_network": false,\ "high_quality_ips_only": false,\ "bundle_info": null,\ "bundle_addons": [],\ "created_at": "2022-06-14T11:58:10.246406-07:00",\ "updated_at": "2022-06-14T11:58:10.246406-07:00"\ }\ ] } Update plan[](https://apidocs.webshare.io/subscription/plan#update-plan) ------------------------------------------------------------------------- This endpoint lets you update an existing plan. You can only update the `automatic_refresh_next_at` field of the Plan object. ### Request & Response[](https://apidocs.webshare.io/subscription/plan#request--response-1) PATCH https://proxy.webshare.io/api/v2/subscription/plan// PythonJavascriptcURL update\_plan.py import requests response = requests.patch( "https://proxy.webshare.io/api/v2/subscription/plan//", json={ "automatic_refresh_next_at":"2022-06-14T11:58:10.246406-07:00" }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 2, "status": "active", "bandwidth_limit": 50.0, "monthly_price": 9.99, "yearly_price": 49.99, "proxy_type": "shared", "proxy_subtype": "default", "proxy_count": 1000, "proxy_countries": {"ZZ": 1000}, "required_site_checks": ["google_search"], "on_demand_refreshes_total": 0, "on_demand_refreshes_used": 0, "on_demand_refreshes_available": 0, "automatic_refresh_frequency": 0, "automatic_refresh_last_at": null, "automatic_refresh_next_at": "2022-06-14T11:58:10.246406-07:00", "proxy_replacements_total": 10, "proxy_replacements_used": 0, "proxy_replacements_available": 10, "subusers_total": 3, "subusers_used": 0, "subusers_available": 3, "is_unlimited_ip_authorizations": true, "is_high_concurrency": true, "is_2x_concurrency": false, "is_high_priority_network": false, "high_quality_ips_only": false, "bundle_info": null, "bundle_addons": [], "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Retrieve plan[](https://apidocs.webshare.io/subscription/plan#retrieve-plan) ----------------------------------------------------------------------------- This endpoint returns the plan. You can find the active plan id from the subscription object. ### Parameters[](https://apidocs.webshare.io/subscription/plan#parameters) | Parameter | Type | Description | | --- | --- | --- | | `ID` | `int` | The ID of the plan to retrieve | ### Request & Response[](https://apidocs.webshare.io/subscription/plan#request--response-2) GET https://proxy.webshare.io/api/v2/subscription/plan// PythonJavascriptcURL retrieve\_plan.py import requests response = requests.get( "https://proxy.webshare.io/api/v2/subscription/plan//", headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "id": 2, "status": "active", "bandwidth_limit": 50.0, "monthly_price": 9.99, "yearly_price": 49.99, "proxy_type": "shared", "proxy_subtype": "default", "proxy_count": 1000, "proxy_countries": {"ZZ": 1000}, "required_site_checks": ["google_search"], "on_demand_refreshes_total": 0, "on_demand_refreshes_used": 0, "on_demand_refreshes_available": 0, "automatic_refresh_frequency": 0, "automatic_refresh_last_at": null, "automatic_refresh_next_at": null, "proxy_replacements_total": 10, "proxy_replacements_used": 0, "proxy_replacements_available": 10, "subusers_total": 3, "subusers_used": 0, "subusers_available": 3, "is_unlimited_ip_authorizations": true, "is_high_concurrency": true, "is_2x_concurrency": false, "is_high_priority_network": false, "high_quality_ips_only": false, "bundle_info": null, "bundle_addons": [], "created_at": "2022-06-14T11:58:10.246406-07:00", "updated_at": "2022-06-14T11:58:10.246406-07:00" } Upgrade plan[](https://apidocs.webshare.io/subscription/plan#upgrade-plan) --------------------------------------------------------------------------- This endpoint lets you upgrade an existing plan. Your subscription will be credits according to the duration/bandwidth left in the current plan and will charge you with part of new plan price according to how much days left in the current subscription period. The upgrade endpoint uses the same parameters as the [Subscription pricing](https://apidocs.webshare.io/subscription/pricing) endpoint with 2 additional fields: `payment_method` and `recaptcha`. This API endpoint requires recaptcha validation if a payment is required. If you have enough account credits, no payment is required. When a payment is required you should not be using this API endpoint programmatically and only use it from the Webshare Dashboard. ### Request fields[](https://apidocs.webshare.io/subscription/plan#request-fields) The upgrade API uses the same parameters as the [Subscription pricing](https://apidocs.webshare.io/subscription/pricing) endpoint with one additional field: `payment_method`. | Parameter | Type | Description | | --- | --- | --- | | `payment_method` | `string` | Can be 3 unique options. 1) `null`, use the payment on file (same as `subscription.payment_method`). 2) Use an existing [PaymentMethod](https://apidocs.webshare.io/subscription/plan#payment-method)
id. 3) Add a new payment by using [Stripe PaymentMethod](https://stripe.com/docs/js/payment_methods)
ID (usually starts with "pm\_..."). | | `recaptcha` | `string` | The recaptcha token (can be invisible recaptcha). | ### Response fields[](https://apidocs.webshare.io/subscription/plan#response-fields) | Attributes | Type | Description | | --- | --- | --- | | `payment_required` | `boolean` | Whether a user needs to complete additional steps for the payment or not. If `false`, the purchase is completed and user now has the new plan. | | `plan` | `integer` | The ID of the new Plan object. | | `pending_payment` | `integer` | The ID of the PendingPayment instance. Only present if `payment_required == true`. | | `stripe_client_secret` | `string` | The `client_secret` for the Stripe [PaymentIntent](https://stripe.com/docs/js/payment_intents/confirm_card_payment)
. Only present if `payment_required == true`. | | `stripe_payment_intent` | `string` | The ID of the Stripe [PaymentIntent](https://stripe.com/docs/js/payment_intents/confirm_card_payment)
. Only present if `payment_required == true`. | | `stripe_payment_method` | `string` | The ID of the Stripe [PaymentMethod](https://stripe.com/docs/js/payment_methods/create_payment_method)
. Only present if `payment_required == true`. | ### Request & Response[](https://apidocs.webshare.io/subscription/plan#request--response-3) POST https://proxy.webshare.io/api/v2/subscription/plan//upgrade/ PythonJavascript upgrade\_plan.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subscription/plan//upgrade/", json={ "proxy_type": "shared", "proxy_subtype": "default", "proxy_countries": {"US": 100}, "bandwidth_limit": 5000, "on_demand_refreshes_total": 0, "automatic_refresh_frequency": 0, "proxy_replacements_total": 0, "subusers_total": 3, "is_unlimited_ip_authorizations": False, "is_high_concurrency": False, "is_2x_concurrency": False, "is_high_priority_network": False, "high_quality_ips_only": False, "term": "monthly", "payment_method": 3, "recaptcha": "...", }, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "payment_required": true, "plan": 2, "pending_payment": 3, "stripe_client_secret": "...", "stripe_payment_intent": "...", "stripe_payment_method": "..." } Cancel plan[](https://apidocs.webshare.io/subscription/plan#cancel-plan) ------------------------------------------------------------------------- This endpoint lets you cancel an existing plan. Your subscription will be credits according to the duration/bandwidth left in that plan. ### Request & Response[](https://apidocs.webshare.io/subscription/plan#request--response-4) POST https://proxy.webshare.io/api/v2/subscription/plan//cancel/ PythonJavascriptcURL cancel\_plan.py import requests response = requests.post( "https://proxy.webshare.io/api/v2/subscription/plan//cancel/", json={}, headers={"Authorization": "Token APIKEY"} ) response.json() The commands above return JSON structured like this: response.json { "success": true, "transaction": 12 } [Subscription](https://apidocs.webshare.io/subscription "Subscription") [Available assets](https://apidocs.webshare.io/subscription/assets "Available assets") ---