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 can be omited 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, but it's not recommended.


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. By default it is ommited. In rare cases old and new IPs can be the same.

  • from_cache (default: false)

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

Response examples
{
    "success": true,
    "new_ip": "203.0.113.177",
    "id": 123
}
{
    "success": true,
    "from_cache": true,
    "old_ip": "203.0.113.80",
    "new_ip": "203.0.113.114",
    "id": 123
}
No such proxy
{
    "detail": "Request was throttled. Expected available in 30 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
}
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    By default it is ommited.\n    In rare cases old and new IPs can be the same.\n\n -  *from_cache* (default: `false`)\n\n    If true return cached `old_ip` value, else get fresh one before change ip attempt.\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    \"new_ip\": \"203.0.113.177\",\n    \"id\": 123\n}\n</pre>\n\n<pre class=\"prettyprint\">\n{\n    \"success\": true,\n    \"from_cache\": true,\n    \"old_ip\": \"203.0.113.80\",\n    \"new_ip\": \"203.0.113.114\",\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 30 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/"
    }
]