Skip to content

Traffic plans

API Methods

Method Action Description
list get list of tariff plans Returns a list of suitable traffic tariff plans for the specified server (id) or location. Supports filtering by hardware type and price conversion to EUR/USD/RUB.

traffic_plans/list

Returns a list of suitable traffic tariff plans for the specified server (id) or location. Supports filtering by hardware type and price conversion to EUR/USD/RUB.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: list
id int Server ID for selecting suitable tariff plans
location string Location code (data center) for filtering plans
instance int Preset ID to get a list of plans compatible with the preset configuration
vm string Parameter vm (found in code)
traffic_plans array<array> Parameter traffic_plans (found in code)
all_tags array<array> Parameter all_tags (found in code)
exclude_list string Parameter exclude_list (found in code)
email string Parameter email (found in code)

Example Request

curl -s "https://api.hostkey.com/traffic_plans.php" -X POST \
--data "action=list" \
--data "vm=VALUE" \
--data "traffic_plans[]=VALUE" \
--data "traffic_plans[]=VALUE2" \
--data "all_tags[]=VALUE" \
--data "all_tags[]=VALUE2" \
--data "exclude_list=VALUE" \
--data "email=VALUE"
Example of a successful response
{
"result": "OK",
"action": "list",
"traffic_plans": [
  {
    "id": 101,
    "name": "Standard 100G",
    "active": 1,
    "location": "AMS",
    "locations": "AMS,LDN",
    "limit_in": 100000,
    "limit_out": 100000,
    "rate_in": 1000,
    "rate_out": 1000,
    "bandwidth": 1000,
    "currency_id": 0,
    "price": 49.99,
    "web_plan": 0,
    "main_plan": 1,
    "billing_plan": {
      "EUR": 49.99,
      "USD": 58.99,
      "USD": 5000.0
    }
  },
  {
    "id": 102,
    "name": "Premium Unlimited",
    "active": 1,
    "location": "AMS",
    "locations": "AMS",
    "limit_in": -1,
    "limit_out": -1,
    "rate_in": 10000,
    "rate_out": 10000,
    "bandwidth": 10000,
    "currency_id": 0,
    "price": 199.99,
    "web_plan": 1,
    "main_plan": 0,
    "billing_plan": {
      "EUR": 199.99,
      "USD": 235.99,
      "RUB": 20000.0
    }
  }
]
}
Failure response
{
"code": -1,
"message": "no suitable traffic plans found for location or id"
}

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×