Get all countries
Using the /countries endpoint, you can retrieve data on over 140 countries where airtime top-ups can be made with the Airtime API
Countries
GET https://topups.reloadly.com/countries
Headers
Authorization*
string
Your access token is required as a bearer token in the request's header
[
{
"isoName":"AF",
"name":"Afghanistan",
"currencyCode":"AFN",
"currencyName":"Afghan Afghani",
"currencySymbol":"؋",
"flag":"https://s3.amazonaws.com/rld-flags/af.svg",
"callingCodes":[
"+93"
]
},
{
"isoName":"AS",
"name":"American Samoa",
"currencyCode":"USD",
"currencyName":"US Dollar",
"currencySymbol":"$",
"flag":"https://s3.amazonaws.com/rld-flags/as.svg",
"callingCodes":[
"+1684"
]
},
{
"isoName":"AI",
"name":"Anguilla",
"currencyCode":"XCD",
"currencyName":"East Caribbean Dollar",
"currencySymbol":"XCD",
"flag":"https://s3.amazonaws.com/rld-flags/ai.svg",
"callingCodes":[
"+1264"
]
},
{
"isoName":"AG",
"name":"Antigua and Barbuda",
"currencyCode":"XCD",
"currencyName":"East Caribbean Dollar",
"currencySymbol":"XCD",
"flag":"https://s3.amazonaws.com/rld-flags/ag.svg",
"callingCodes":[
"+1268"
]
}
]{
"timeStamp":"2021-05-11 21:14:00",
"message":"Full authentication is required to access this resource",
"path":"/countries",
"errorCode":"INVALID_TOKEN",
"infoLink":null,
"details":[
]
}{
"timestamp":"2021-05-12T09:23:19.861+0000",
"status":404,
"error":"Not Found",
"message":"No message available",
"path":"/country"
}Request samples
curl --location --request GET 'https://topups.reloadly.com/countries' \
--header 'Accept: application/com.reloadly.topups-v1+json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE'using System;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
namespace WebAPIClient {
class Program {
static async Task Main(string[] args) {
await ApiCall();
}
private static async Task ApiCall() {
var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/countries");
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
using
var httpClient = new HttpClient();
var response = await httpClient.SendAsync(message);
var responseBody = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
Console.WriteLine(result);
}
}
}package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://topups.reloadly.com/countries"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://topups.reloadly.com/countries")
.method("GET", null)
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
.build();
Response response = client.newCall(request).execute();var request = require('request');
var options = {
'method': 'GET',
'url': 'https://topups.reloadly.com/countries',
'headers': {
'Accept': 'application/com.reloadly.topups-v1+json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://topups.reloadly.com/countries',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/com.reloadly.topups-v1+json',
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;import requests
import json
url = "https://topups.reloadly.com/countries"
payload={}
headers = {
'Accept': 'application/com.reloadly.topups-v1+json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)Response parameters
Parameter
Type
Description
isoName
string
This indicates the ISO code of the country
name
string
This indicates the country's name
currencyCode
string
This indicates the code of the country's currency
currencyName
string
This indicates the name of the country's currency
currencySymbol
string
This indicates the symbol of the country's currency
flag
string
This is a link to an SVG image of the country's flag
callingCodes
string
This indicates the country's international dialing code
Last updated
Was this helpful?