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.
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.
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/japanYou 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'])Explore the API
Try these endpoints next:
/api/v1/countries?sort=populationCountries sorted by population
/api/v1/countries/brazil/cities?sort=populationCities in Brazil by population
/api/v1/search?q=tokyo&type=citySearch for cities named Tokyo
/api/v1/rankings/populationWorld population ranking
/api/v1/cities/3435910/nearby?radius=100Cities 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.