Free & Stable

Free Reliable Country Data API

Get unlimited access and stop wasting time with maintaining third party libraries. CountryAPI provides you with an extensive and reliable Country Data REST API.

Get a free API key in minutes and try it for yourself.

Experience a highly reliable free country data solution

Our Rest API features all the functions to implement and utilise data for your use case.

Integrade CountryAPI with just a few lines of code

We believe that developers should focus on their code and therefore provide them tools that are easy to integrate and well maintained.

  var settings = {
  "url": "https://countryapi.io/api/all",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
import requests
import requests

url = "https://countryapi.io/api/all"

payload={}
headers = {
  'Authorization': 'YOUR_API_KEY',
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://countryapi.io/api/all',
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require "uri"
require "uri"
require "net/http"

url = URI("https://countryapi.io/api/all")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "YOUR_API_KEY"

response = http.request(request)
puts response.read_body

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://countryapi.io/api/all")
  .method("GET", null)
  .addHeader("Authorization", "YOUR_API_KEY")
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://countryapi.io/api/all"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "YOUR_API_KEY")

  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))
}
}

curl 'https://countryapi.io/api/language/swedish?apikey=YOUR_API_KEY'

Get Started for Free. Sign up Now.

Sign up for Free
Image