API Documentation

Complete REST API for accessing global data across 200+ countries. Get started in minutes.

Quick Start

1. Get API Key

Sign up and generate your API key from the dashboard

Sign up free →
2. Make Request

Use your API key to access any endpoint

View examples →
3. Build Apps

Integrate global data into your applications

See SDKs →
Example RequestcURL
curl -X GET "https://api.costmaps.com/api/v1/countries/US" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example ResponseJSON
{
  "code": "US",
  "name": "United States",
  "region": "North America",
  "population": 331900000,
  "currency": "USD",
  "capital": "Washington D.C."
}

Fast & Reliable

Sub-200ms response times with 99.9% uptime SLA on Enterprise plans

Secure

Enterprise-grade security with JWT authentication and rate limiting

Comprehensive

200+ countries with 9 data modules updated daily to bi-annually

API Reference

Base URL

https://api.costmaps.com/api/v1

Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Rate Limits

  • • Free: 100 requests/day
  • • Pro: 1,000 requests/day
  • • Business: 10,000 requests/day
  • • Enterprise: 100,000 requests/day

Endpoints

Countries

GET
/countries

List all countries

GET
/countries/:code

Get country details

Cost of Living

GET
/cost-of-living/countries/:code

Get cost of living data

GET
/cost-of-living/compare

Compare multiple countries

Economic Indicators

GET
/economic/countries/:code

Get economic indicators

Real Estate

GET
/real-estate/countries/:code

Get real estate metrics

Jobs & Salaries

GET
/jobs/salaries/:code

Get salary data by job category

GET
/jobs/tax-calculator/:code

Calculate take-home pay

Metrics (Healthcare, Education, Safety, Transportation)

GET
/metrics/:code

Get all metrics for a country

Full API Reference: For complete documentation with all parameters, responses, and error codes, visit our OpenAPI/Swagger documentation →

Code Examples

Python

import requests

API_KEY = "your_api_key_here"
BASE_URL = "https://api.costmaps.com/api/v1"

headers = {
    "Authorization": f"Bearer {API_KEY}"
}

# Get country data
response = requests.get(
    f"{BASE_URL}/countries/US",
    headers=headers
)

data = response.json()
print(data)

# Compare countries
response = requests.get(
    f"{BASE_URL}/cost-of-living/compare",
    params={"countries": "US,UK,DE"},
    headers=headers
)

comparison = response.json()
print(comparison)

JavaScript / Node.js

const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://api.costmaps.com/api/v1';

// Using fetch
async function getCountryData(countryCode) {
  const response = await fetch(`${BASE_URL}/countries/${countryCode}`, {
    headers: {
      'Authorization': `Bearer ${API_KEY}`
    }
  });

  const data = await response.json();
  return data;
}

// Using axios
const axios = require('axios');

axios.get(`${BASE_URL}/cost-of-living/countries/US`, {
  headers: { 'Authorization': `Bearer ${API_KEY}` }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

cURL

# Get country data
curl -X GET "https://api.costmaps.com/api/v1/countries/US" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Compare countries
curl -X GET "https://api.costmaps.com/api/v1/cost-of-living/compare?countries=US,UK,DE" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get salaries
curl -X GET "https://api.costmaps.com/api/v1/jobs/salaries/US" \
  -H "Authorization: Bearer YOUR_API_KEY"

SDKs & Libraries

Coming Soon

Official SDKs for Python, JavaScript, Ruby, PHP, and Go are in development.

In the meantime, you can use any HTTP client library to interact with our REST API. All endpoints follow standard REST conventions.

Error Handling

Status CodeMeaningDescription
200OKRequest successful
400Bad RequestInvalid parameters
401UnauthorizedMissing or invalid API key
403ForbiddenAccess denied (tier restriction)
404Not FoundResource not found
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error
Error Response Format
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "You have exceeded your daily API limit",
    "details": {
      "limit": 100,
      "used": 100,
      "reset_at": "2026-03-20T00:00:00Z"
    }
  }
}

Need Help?

Our support team is here to help you integrate CostMaps into your applications.