AirProxy REST API

In addition to referred request options you can set format as json (raw response) or api (user friendly UI), default is autodetect depends on content type.

API key option is ignored if valid session cookie present (if you logged in to the site).

Corresponding proxy id can be found in ID column of My proxies page. Alternatively id can be specified as domain:port (e.g. s1.airproxy.io:12345).


Get API Key

GET /api/proxy/get_key/

Returns your API key.

You can request it only if logged in to the site.

Response examples
{
    "success": true,
    "key": "ieHie2hilahw0chuifex7ceu8cai7coc"
}
{
    "success": false,
    "error": "You are not allowed to use API."
}

Change proxy external IP

GET /api/proxy/change_ip/

Rotates proxy external IP and returns current external IP.

In case of check failure new_ip and/or old_ip values may return null.

Too frequent requests will be throttled with HTTP 429 error, in this case response usually has "Retry-After" HTTP header with recommended sleep time in seconds before the next retry. Minimal time between requests for specific proxy is 5 sec. Your request may be still throttled if the previous call taking more than 5 sec and is not completed yet. Maximum time for external IP to be changed not going to exceed 165 sec.

Request options:

  • key (required if not authenticated)

    API key.

  • id (required)

    Proxy ID (recommended). Alternatively domain:port notation also acceptable.

  • async (default: false)

    Request external IP change and return immediately without waiting for the result. In a few seconds you may manually verify if external IP was changed or not by calling our API Get proxy external IP endpoint, or by making HTTP/HTTPS request via your proxy to airproxy.io/ip or similar third party service (like ifconfig.co, ipecho.net/plain, etc.; such services may have various rate limits you should be aware of).

  • show_old_ip (default: false)

    Include previous IP to response as old_ip. For synchronous call there is no any overhead to include it but for historic reasons it is omitted by default. For asynchronous call and from_cache=false current external IP will be updated first. In rare cases old and new IPs can be the same and/or null.

  • from_cache (default: false)

    Makes sense only for async=true and show_old_ip=true. If true return cached external IP value as old_ip, else get fresh one before external IP change call. Max time used for external IP caching is 120 sec.

  • fp (default: keep)

    Experimental, use at your own risk.

    Apply TCP/IP fingerprint to outgoing packets.

    This might be useful to pretend that you use different Operation System if the remote host using passive traffic analyzer (like "p0f"). If you use this setting to pretend that you use different OS, you should care about other parts of your infrastructure to match, e.g. web browser user-agent, version, etc.

    Native OS fingerprint of our proxies is Linux, but some ISPs may use transparent proxy on their side, if so TCP/IP fingerprint may be different even if you've applied custom one by this option.

    This setting is preserved across multiple change IP calls.

    To check existing setup you may use third party services (using your proxy), e.g. https://tcpip.incolumitas.com/classify?detail=1

    Supported values:

    • keep (the same as absent argument)

      Keep existing settings.

    • reset or empty string

      Reset existing settings - do not apply any fingerprint, use native one (Linux).

    • string in p0f v3 TCP SYN format

      Apply this fingerprint to all outgoing TCP SYN packets (connection initialization packet). For all other packets only TTL value is applied.

      Example (Windows 10 variation): *:128:0:*:64240,*:mss,nop,nop,sok:df,id+:0

      Since it's HTTP GET argument you may need to use urlencoded value, for the example above it's %2A%3A128%3A0%3A%2A%3A64240%2C%2A%3Amss%2Cnop%2Cnop%2Csok%3Adf%2Cid%2B%3A0 or at least *:128:0:*:64240,*:mss,nop,nop,sok:df,id%2B:0

      More you may find in https://github.com/p0f/p0f/blob/master/p0f.fp

      We have plans to create a service to help you check your existing fingerprint (which you may want to apply to your proxies then) but it's not ready yet.

Response examples
{
    "success": true,
    "new_ip": "203.0.113.177",
    "id": 123
}
{
    "success": true,
    "new_ip": null,
    "old_ip": "203.0.113.80",
    "id": 123
}
{
    "success": true,
    "async": true,
    "old_ip": "203.0.113.177"
    "from_cache": false,
    "id": 123,
}
No such proxy
{
    "detail": "Request was throttled. Expected available in 24 seconds."
}
{
    "detail": "Request was throttled: previous call is still running. Expected available in less than 42 seconds."
}

Get proxy external IP

GET /api/proxy/ext_ip/

Returns proxy current external IP.

In case of check failure ip value may return null.

Request options:

  • key (required if not authenticated)

    API key.

  • id (required)

    Proxy ID (recommended). Alternatively domain:port notation also acceptable.

  • from_cache (default: false)

    If true return cached ip value, else get fresh one. Max time used for external IP caching is 120 sec.

Response examples
{
    "success": true,
    "ip": "203.0.113.183",
    "from_cache": false,
    "id": 123
}
No such proxy

Get proxy traffic usage

GET /api/proxy/traffic/

Returns proxy traffic usage for specified time range.

Request options:

  • key (required if not authenticated)

    API key.

  • id (required)

    Proxy ID (recommended). Alternatively domain:port notation also acceptable.

  • from

    Can be unix time (in UTC timezone) or iso-8601.

    OR

    delta (default: 2592000 aka 30d)

    Timedelta before till. Ignored if from specified.

    Optional suffixes supported:

    • s: second (assumed if no suffix)
    • m: minute
    • h: hour
    • d: day
    • w: week
  • till (default: now)

    Can be unix time (in UTC timezone) or iso-8601.

  • speed_unit (default: bps)

    Output speed values using this unit. Can be one of:

    • bps: bits per second
    • Kbps: kilobits per second (103)
    • Mbps: megabits per second (106)
    • Bps: bytes per second (8)
    • KBps: kilobytes per second (8*103)
    • MBps: megabytes per second (8*106)
    • KiBps: kibibytes per second (8*1024)
    • MiBps: mebibytes per second (8*10242)
  • data_unit (default: b)

    Output data values using this unit. Can be one of:

    • b: bit
    • B: byte (8)
    • KB: kilobyte (8*103)
    • MB: megabyte (8*106)
    • GB: gigabyte (8*109)
    • KiB: kibibyte (8*1024)
    • MiB: mebibyte (8*10242)
    • GiB: gibibyte (8*10243)
Response examples
{
    "success": true,
    "from": "2020-07-26T01:30:36Z",
    "till": "2020-08-25T01:30:36Z",
    "speed_avg": {
        "unit": "bps",
        "incoming": 1848.0,
        "outgoing": 189.0,
        "total": 2037.0
    },
    "data": {
        "unit": "b",
        "incoming": 4777902090.0,
        "outgoing": 488797710.0,
        "total": 5266699800.0
    },
    "id": 123
}
{
    "success": false,
    "error": "Failed to get traffic usage",
    "id": 123
}

Reboot proxy's dongle

GET /api/proxy/reboot/

Request reboot for the dongle related to specified proxy and return immediately. The proxy going to be available 20-60 seconds later.

Request options:

  • key (required if not authenticated)

    API key.

  • id (required)

    Proxy ID (recommended). Alternatively domain:port notation also acceptable.

Response examples
{
    "success": true,
    "info": "Reboot initiated. It may take 20-60 seconds to complete.",
    "id": 123
}
{
    'success': false,
    'error': "Failed to call reboot",
    "id": 123
}

Proxies list

GET /api/proxy/list/

Returns the list of your proxies, optionally filtered by provided options.

Request options:

  • key (required if not authenticated)

    API key.

  • id

    Proxy ID (recommended). Alternatively domain:port notation also acceptable.

  • ip

    Proxy public domain (or IP address if it shown as IP address in your UI) (case insensitive).

  • port

    Proxy public port.

  • username

    Proxy username (case sensitive).

  • isp

    ISP (Internet Service Provider) name of SIM card (case sensitive).

  • comment

    Comment exact match (case sensitive).

  • comment_re

    POSIX regular expression for comment field match (case sensitive). Used only if comment filtering option is not specified.

Response examples
{
    "proxies": [
        {
            "id": 9042,
            "ip": "s1.airproxy.io",
            "port": 10142,
            "username": "johndoe",
            "password": "EThohf9keaSa4h",
            "src_whitelist": ["203.0.113.200/32", "198.51.100.0/24"],
            "isp": "Wind",
            "comment": "Nothing is more useful than useless comment",
            "in_use_from": "2022-05-29T12:29:45Z",
            "in_use_till": "2022-10-07T10:39:55Z",
            "ext_ip_upd_interval": "60-90",
            "ext_ip_upd_calendar": ""
        },
        {
            "id": 9717,
            "ip": "s2.airproxy.io",
            "port": 20114,
            "username": "johndoe",
            "password": "Chie8eP7oB6fa5",
            "src_whitelist": [],
            "isp": "Vodafone",
            "comment": "",
            "in_use_from": "2022-05-29T12:29:45Z",
            "in_use_till": "2022-10-07T10:39:55Z",
            "ext_ip_upd_interval": null,
            "ext_ip_upd_calendar": "weekly"
        }
    ],
    "count": 2,
    "success": true
}
GET /api/proxy/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "name": "Get API Key",
        "description": "Returns your API key.\n\nYou can request it only if logged in to the site.\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"key\": \"ieHie2hilahw0chuifex7ceu8cai7coc\"\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": false,\n    \"error\": \"You are not allowed to use API.\"\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/get_key/"
    },
    {
        "name": "Change proxy external IP",
        "description": "Rotates proxy external IP and returns current external IP.\n\nIn case of check failure `new_ip` and/or `old_ip` values may return null.\n\nToo frequent requests will be throttled with HTTP 429 error, in this case response usually has \"Retry-After\" HTTP header with recommended sleep time in seconds before the next retry.\nMinimal time between requests for specific proxy is 5 sec. Your request may be still throttled if the previous call taking more than 5 sec and is not completed yet. Maximum time for external IP to be changed not going to exceed 165 sec.\n\n## Request options:\n\n -  ***key*** (required if not authenticated)\n\n    API key.\n\n -  ***id*** (required)\n\n    Proxy ID (recommended). Alternatively *domain:port* notation also acceptable.\n\n - *async* (default: `false`)\n\n    Request external IP change and return immediately without waiting for the result.\n    In a few seconds you may manually verify if external IP was changed or not by calling our API [Get proxy external IP](/api/proxy/ext_ip/) endpoint, or by making HTTP/HTTPS request via your proxy to [airproxy.io/ip](http://airproxy.io/ip) or similar third party service (like [ifconfig.co](http://ifconfig.co), [ipecho.net/plain](http://ipecho.net/plain), etc.; such services may have various rate limits you should be aware of).\n\n -  *show_old_ip* (default: `false`)\n\n    Include previous IP to response as `old_ip`.\n    For synchronous call there is no any overhead to include it but for historic reasons it is omitted by default.\n    For asynchronous call and `from_cache=false` current external IP will be updated first.\n    In rare cases old and new IPs can be the same and/or null.\n\n -  *from_cache* (default: `false`)\n\n    Makes sense only for `async=true` and `show_old_ip=true`.\n    If true return cached external IP value as `old_ip`, else get fresh one before external IP change call.\n    Max time used for external IP caching is 120 sec.\n\n -  *fp* (default: `keep`)\n\n    ***Experimental***, use at your own risk.\n\n    Apply TCP/IP fingerprint to outgoing packets.\n\n    This might be useful to pretend that you use different Operation System if the remote host using passive traffic analyzer (like \"p0f\").\n    If you use this setting to pretend that you use different OS, you should care about other parts of your infrastructure to match, e.g. web browser user-agent, version, etc.\n\n    Native OS fingerprint of our proxies is Linux, but some ISPs may use transparent proxy on their side, if so TCP/IP fingerprint may be different even if you've applied custom one by this option.\n\n    This setting is preserved across multiple change IP calls.\n\n    To check existing setup you may use third party services (using your proxy), e.g. `https://tcpip.incolumitas.com/classify?detail=1`\n\n    Supported values:\n\n     - `keep` (the same as absent argument)\n\n        Keep existing settings.\n\n     - `reset` or empty string\n\n        Reset existing settings - do not apply any fingerprint, use native one (Linux).\n\n     - string in p0f v3 TCP SYN format\n\n        Apply this fingerprint to all outgoing TCP SYN packets (connection initialization packet).\n        For all other packets only TTL value is applied.\n\n        Example (Windows 10 variation): `*:128:0:*:64240,*:mss,nop,nop,sok:df,id+:0`\n\n        Since it's HTTP GET argument you may need to use urlencoded value, for the example above it's `%2A%3A128%3A0%3A%2A%3A64240%2C%2A%3Amss%2Cnop%2Cnop%2Csok%3Adf%2Cid%2B%3A0` or at least `*:128:0:*:64240,*:mss,nop,nop,sok:df,id%2B:0`\n\n        More you may find in `https://github.com/p0f/p0f/blob/master/p0f.fp`\n\n        We have plans to create a service to help you check your existing fingerprint (which you may want to apply to your proxies then) but it's not ready yet.\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"new_ip\": \"203.0.113.177\",\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"new_ip\": null,\n    \"old_ip\": \"203.0.113.80\",\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"async\": true,\n    \"old_ip\": \"203.0.113.177\"\n    \"from_cache\": false,\n    \"id\": 123,\n}\n</pre>\n\n<pre class=\"prettyprint\">\nNo such proxy\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"detail\": \"Request was throttled. Expected available in 24 seconds.\"\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"detail\": \"Request was throttled: previous call is still running. Expected available in less than 42 seconds.\"\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/change_ip/"
    },
    {
        "name": "Get proxy external IP",
        "description": "Returns proxy current external IP.\n\nIn case of check failure `ip` value may return null.\n\n## Request options:\n\n -  ***key*** (required if not authenticated)\n\n    API key.\n\n -  ***id*** (required)\n\n    Proxy ID (recommended). Alternatively *domain:port* notation also acceptable.\n\n -  *from_cache* (default: `false`)\n\n    If true return cached `ip` value, else get fresh one.\n    Max time used for external IP caching is 120 sec.\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"ip\": \"203.0.113.183\",\n    \"from_cache\": false,\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\nNo such proxy\n</pre>\n\n</details>",
        "url": "/api/proxy/ext_ip/"
    },
    {
        "name": "Get proxy traffic usage",
        "description": "Returns proxy traffic usage for specified time range.\n\n## Request options:\n\n -  ***key*** (required if not authenticated)\n\n    API key.\n\n -  ***id*** (required)\n\n    Proxy ID (recommended). Alternatively *domain:port* notation also acceptable.\n\n -  *from*\n\n    Can be unix time (in UTC timezone) or [iso-8601](https://en.wikipedia.org/wiki/ISO_8601).\n\n    OR\n\n    *delta* (default: 2592000 aka `30d`)\n\n    Timedelta before `till`. Ignored if `from` specified.\n\n    Optional suffixes supported:\n\n     - `s`: second (assumed if no suffix)\n     - `m`: minute\n     - `h`: hour\n     - `d`: day\n     - `w`: week\n\n -  *till* (default: `now`)\n\n    Can be unix time (in UTC timezone) or [iso-8601](https://en.wikipedia.org/wiki/ISO_8601).\n\n -  *speed_unit* (default: `bps`)\n\n    Output speed values using this unit.\n    Can be one of:\n\n     - `bps`: bits per second\n     - `Kbps`: kilobits per second (10<sup>3</sup>)\n     - `Mbps`: megabits per second (10<sup>6</sup>)\n     - `Bps`: bytes per second (8)\n     - `KBps`: kilobytes per second (8\\*10<sup>3</sup>)\n     - `MBps`: megabytes per second (8\\*10<sup>6</sup>)\n     - `KiBps`: kibibytes per second (8\\*1024)\n     - `MiBps`: mebibytes per second (8\\*1024<sup>2</sup>)\n\n -  *data_unit* (default: `b`)\n\n    Output data values using this unit.\n    Can be one of:\n\n     - `b`: bit\n     - `B`: byte (8)\n     - `KB`: kilobyte (8\\*10<sup>3</sup>)\n     - `MB`: megabyte (8\\*10<sup>6</sup>)\n     - `GB`: gigabyte (8\\*10<sup>9</sup>)\n     - `KiB`: kibibyte (8\\*1024)\n     - `MiB`: mebibyte (8\\*1024<sup>2</sup>)\n     - `GiB`: gibibyte (8\\*1024<sup>3</sup>)\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"from\": \"2020-07-26T01:30:36Z\",\n    \"till\": \"2020-08-25T01:30:36Z\",\n    \"speed_avg\": {\n        \"unit\": \"bps\",\n        \"incoming\": 1848.0,\n        \"outgoing\": 189.0,\n        \"total\": 2037.0\n    },\n    \"data\": {\n        \"unit\": \"b\",\n        \"incoming\": 4777902090.0,\n        \"outgoing\": 488797710.0,\n        \"total\": 5266699800.0\n    },\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": false,\n    \"error\": \"Failed to get traffic usage\",\n    \"id\": 123\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/traffic/"
    },
    {
        "name": "Reboot proxy's dongle",
        "description": "Request reboot for the dongle related to specified proxy and return immediately.\nThe proxy going to be available 20-60 seconds later.\n\n## Request options:\n\n -  ***key*** (required if not authenticated)\n\n    API key.\n\n -  ***id*** (required)\n\n    Proxy ID (recommended). Alternatively *domain:port* notation also acceptable.\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"info\": \"Reboot initiated. It may take 20-60 seconds to complete.\",\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    'success': false,\n    'error': \"Failed to call reboot\",\n    \"id\": 123\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/reboot/"
    },
    {
        "name": "Proxies list",
        "description": "Returns the list of your proxies, optionally filtered by provided options.\n\n## Request options:\n\n -  ***key*** (required if not authenticated)\n\n    API key.\n\n -  *id*\n\n    Proxy ID (recommended). Alternatively *domain:port* notation also acceptable.\n\n -  *ip*\n\n    Proxy public domain (or IP address if it shown as IP address in your UI) (case insensitive).\n\n -  *port*\n\n    Proxy public port.\n\n -  *username*\n\n    Proxy username (case sensitive).\n\n -  *isp*\n\n    ISP (Internet Service Provider) name of SIM card (case sensitive).\n\n - *comment*\n\n    Comment exact match (case sensitive).\n\n - *comment_re*\n\n    [POSIX regular expression](https://www.postgresql.org/docs/10/functions-matching.html#FUNCTIONS-POSIX-REGEXP) for *comment* field match (case sensitive). Used only if *comment* filtering option is not specified.\n\n<details>\n<summary>Response examples</summary>\n\n<pre class=\"prettyprint\">\n{\n    \"proxies\": [\n        {\n            \"id\": 9042,\n            \"ip\": \"s1.airproxy.io\",\n            \"port\": 10142,\n            \"username\": \"johndoe\",\n            \"password\": \"EThohf9keaSa4h\",\n            \"src_whitelist\": [\"203.0.113.200/32\", \"198.51.100.0/24\"],\n            \"isp\": \"Wind\",\n            \"comment\": \"Nothing is more useful than useless comment\",\n            \"in_use_from\": \"2022-05-29T12:29:45Z\",\n            \"in_use_till\": \"2022-10-07T10:39:55Z\",\n            \"ext_ip_upd_interval\": \"60-90\",\n            \"ext_ip_upd_calendar\": \"\"\n        },\n        {\n            \"id\": 9717,\n            \"ip\": \"s2.airproxy.io\",\n            \"port\": 20114,\n            \"username\": \"johndoe\",\n            \"password\": \"Chie8eP7oB6fa5\",\n            \"src_whitelist\": [],\n            \"isp\": \"Vodafone\",\n            \"comment\": \"\",\n            \"in_use_from\": \"2022-05-29T12:29:45Z\",\n            \"in_use_till\": \"2022-10-07T10:39:55Z\",\n            \"ext_ip_upd_interval\": null,\n            \"ext_ip_upd_calendar\": \"weekly\"\n        }\n    ],\n    \"count\": 2,\n    \"success\": true\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/list/"
    }
]