List regions
const url = 'https://api.roamex.com/v1/regions?lang=nl';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.roamex.com/v1/regions?lang=nl' \ --header 'Authorization: Bearer <token>'Lists the countries and regions that have plans you can buy, regions first. Pass a slug as region to /plans; planCount is the number of plans it returns for that slug. The request body is ignored.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Language of plan and destination names in the response: en, nl, es, de, it, fr, pl, pt, tr, el, cs or ro. Any other value, or none, gives English. It never changes which items are returned or any figure.
Example
nlResponses
Section titled “Responses”Every country and region with plans.
object
Regions first, by plan count from high to low, then countries by name.
object
Pass as region to /plans. A country’s slug is its lower-case country code.
Country codes.
The number of plans /plans returns for this slug.
Number of entries in regions.
Example
{ "success": true, "regions": [ { "slug": "europe", "name": "Europe (30 countries)", "type": "region", "countries": [ "AT", "BE", "DE" ], "countryNames": [ "Austria", "Belgium", "Germany" ], "planCount": 42 }, { "slug": "jp", "name": "Japan", "type": "country", "countries": [ "JP" ], "countryNames": [ "Japan" ], "planCount": 27 } ], "total": 2}Headers
Section titled “Headers”Calls allowed per minute for this endpoint group.
Calls left in the current minute.
When the current window ends, in Unix seconds.
AUTH_ERROR: the key is missing, malformed, unknown or revoked. The message says which, for example Missing Authorization header, Invalid Authorization header format. Use: Bearer <api_key>, Invalid API key format or Invalid API key.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "AUTH_ERROR", "message": "Invalid API key" }}AUTH_ERROR: the account is suspended (Your account is suspended. Please contact support.) or rejected (Account is not approved for API access).
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}NOT_FOUND: the API is switched off on the platform. Every endpoint answers this before the key is checked, with the message This feature is not available.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "NOT_FOUND", "message": "This feature is not available." }}PAYLOAD_TOO_LARGE: the Content-Length header is over 100 KB.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}RATE_LIMITED: the account’s per-minute budget for this endpoint group is used up, or too many refused keys came from this IP address. Wait the Retry-After seconds.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded. Please wait 42 seconds before retrying." }}Headers
Section titled “Headers”Calls allowed per minute for this endpoint group.
Calls left in the current minute.
When the current window ends, in Unix seconds.
Seconds to wait before retrying.
INTERNAL_ERROR: an unexpected error on our side.AUTH_ERRORwith status 500: the key could not be checked because of an error on our side. Retry with backoff.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}Transient. Retry with backoff.
PRICING_UNAVAILABLE: your account pricing could not be confirmed.REGIONS_UNAVAILABLE: the region list could not be loaded.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}
