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",
    "id": 123
}
{
    "success": false,
    "error": "You are not allowed to use API.",
    "id": 123
}

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. Minimal time between requests for specific proxy is 30 sec.

Request options:

  • key (required if not authenticated)

    API key.

  • id (required)

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

  • show_old_ip (default: false)

    Include previous IP to response as old_ip. There is no any overhead to include it but for historic reasons it is ommitted by default. In rare cases old and new IPs can be the same and/or null.

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
}
No such proxy
{
    "detail": "Request was throttled. Expected available in 24 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 immediatelly. 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).

Response examples
{
    "proxies": [
        {
            "id": 9042,
            "ip": "s1.airproxy.io",
            "port": 10142,
            "username": "johndoe",
            "password": "EThohf9keaSa4h",
            "isp": "Wind"
        },
        {
            "id": 9717,
            "ip": "s2.airproxy.io",
            "port": 20114,
            "username": "johndoe",
            "password": "Chie8eP7oB6fa5",
            "isp": "Vodafone"
        }
    ],
    "count": 2,
    "success": true
}
GET /api/proxy/
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    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": false,\n    \"error\": \"You are not allowed to use API.\",\n    \"id\": 123\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. Minimal time between requests for specific proxy is 30 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 -  *show_old_ip* (default: `false`)\n\n    Include previous IP to response as `old_ip`.\n    There is no any overhead to include it but for historic reasons it is ommitted by default.\n    In rare cases old and new IPs can be the same and/or null.\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\">\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</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.\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.\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 immediatelly.\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<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            \"isp\": \"Wind\"\n        },\n        {\n            \"id\": 9717,\n            \"ip\": \"s2.airproxy.io\",\n            \"port\": 20114,\n            \"username\": \"johndoe\",\n            \"password\": \"Chie8eP7oB6fa5\",\n            \"isp\": \"Vodafone\"\n        }\n    ],\n    \"count\": 2,\n    \"success\": true\n}\n</pre>\n\n</details>",
        "url": "/api/proxy/list/"
    }
]