Quickstart

Get started with the Bamwor API in 5 minutes. Register your free API key, authenticate with curl, JavaScript or Python, and query countries and cities.

1

Get your API key

Register for a free API key by sending a POST request:

Register your free API key

We'll send a verification code to your email.

Already have a key? Recover it

2

Make your first request

Use your API key to fetch country data:

curl -H "X-API-Key: bw_live_your_key" \
  https://bamwor.com/api/v1/countries/japan

You can also use the Authorization: Bearer header instead of X-API-Key. Anonymous requests (no key) are limited to 100/day.

JavaScript / Node.js

const res = await fetch('https://bamwor.com/api/v1/countries/japan', {
  headers: { 'X-API-Key': 'bw_live_your_key' }
});
const { data } = await res.json();
console.log(data.names.en, data.stats.population);

Python

import requests

r = requests.get(
    'https://bamwor.com/api/v1/countries/japan',
    headers={'X-API-Key': 'bw_live_your_key'}
)
data = r.json()['data']
print(data['names']['en'], data['stats']['population'])
3

Explore the API

Try these endpoints next:

๐ŸŒ
/api/v1/countries?sort=population

Countries sorted by population

๐Ÿ™๏ธ
/api/v1/countries/brazil/cities?sort=population

Cities in Brazil by population

๐Ÿ”
/api/v1/search?q=tokyo&type=city

Search for cities named Tokyo

๐Ÿ“Š
/api/v1/rankings/population

World population ranking

๐Ÿ“
/api/v1/cities/3435910/nearby?radius=100

Cities near Buenos Aires

Troubleshooting

โ–ถI get 401 INVALID_API_KEY

Make sure you're sending the key in the X-API-Key header or as Authorization: Bearer. Keys start with bw_live_. If you just registered, try again in a few seconds.

โ–ถI get 429 RATE_LIMIT_EXCEEDED

You've exceeded your plan's rate limit. The free plan allows 30 requests/min and 1,000/day. Check X-RateLimit-Remaining in the response headers. Upgrade to Pro for higher limits.

โ–ถThe response is slow

First requests to a given endpoint may be slower while the cache warms up. Subsequent calls hit cache and return in under 50ms. If the issue persists, check your network latency to bamwor.com.

โ–ถHow do I search in Spanish or Portuguese?

The /search endpoint matches against all 4 languages automatically. Just search in your preferred language: /api/v1/search?q=Alemania will find Germany.