Getting Started
How do I get an API key?
How do I get an API key?
- Fill up a Google Form Request an API Key
- Wait for admin to review. It might take 1-2 days to receive API Key.
- Once you’re approved, you will get an API Key.
Is there a free plan available?
Is there a free plan available?
- 3,000 requests per month
- 100 requests per day
- 2 requests per second rate limit
- Access to all endpoints
- No credit card required
How quickly can I start using the API?
How quickly can I start using the API?
Do you provide SDKs for different programming languages?
Do you provide SDKs for different programming languages?
- JavaScript/Node.js
- Python
- PHP
- Java
- C#
- Go
- Ruby
Authentication & Security
How do I authenticate API requests?
How do I authenticate API requests?
Is it safe to use my API key in client-side applications?
Is it safe to use my API key in client-side applications?
- Use server-side applications or serverless functions
- Store API keys in environment variables
- Implement your own backend API that securely calls our API
- Use build-time environment variables for static sites
- API keys in client-side code are visible to anyone
- Malicious users could extract and abuse your API key
- This could lead to unexpected usage and charges
Can I rotate or regenerate my API key?
Can I rotate or regenerate my API key?
- Log into your account
- Navigate to API key management
- Generate a new key
- Update your applications with the new key
- Revoke the old key once migration is complete
What should I do if I get a 401 Unauthorized error?
What should I do if I get a 401 Unauthorized error?
Rate Limits & Usage
What are the current rate limits?
What are the current rate limits?
Plan | Monthly Requests | Daily Requests | Rate Limit |
---|---|---|---|
Community (Free) | 3,000 | 100 | 2 req/second |
Supporter | 30,000 | 1,000 | 10 req/second |
Professional | 150,000 | 5,000 | 25 req/second |
View Full Pricing Details
How can I monitor my API usage?
How can I monitor my API usage?
What happens when I exceed my rate limit?
What happens when I exceed my rate limit?
429 Too Many Requests
response:- Implement exponential backoff retry logic
- Cache responses to reduce API calls
- Monitor usage proactively
- Consider upgrading your plan if limits are consistently hit
Retry-After
header indicates how long to wait before making another request.How can I optimize my API usage to stay within limits?
How can I optimize my API usage to stay within limits?
- Cache country/state data for 24+ hours (rarely changes)
- Cache city data for 12+ hours
- Implement local fallbacks for critical data
- Fetch broader datasets when possible (all countries vs individual requests)
- Use hierarchical endpoints strategically
- Batch related requests together
Data & Endpoints
What data is included for countries, states, and cities?
What data is included for countries, states, and cities?
- ISO2 and ISO3 codes
- Country name and native name
- Phone code and currency information
- Flag emoji and region information
- Latitude and longitude coordinates
- State name and ISO2 code
- Country association
- State type (state, province, region, etc.)
- Latitude and longitude coordinates
- City name and unique ID
- Country and state association
- Latitude and longitude coordinates
- Timezone information (when available)
/countries/{iso2}
) to get complete information including additional metadata.How often is the geographical data updated?
How often is the geographical data updated?
- Country data: Updated as needed for political changes, currency updates, etc.
- State/Province data: Updated for administrative boundary changes
- City data: Regular additions and corrections based on authoritative sources
Can I get all countries, states, and cities in one request?
Can I get all countries, states, and cities in one request?
/countries
- All countries/countries/{countryCode}/states
- States within a country/countries/{countryCode}/cities
- Cities within a country/countries/{countryCode}/states/{stateCode}/cities
- Cities within a state
- Faster response times for specific data
- Reduced bandwidth usage
- Better caching opportunities
- More manageable response sizes
Do you provide latitude and longitude coordinates?
Do you provide latitude and longitude coordinates?
- ✅ Countries: Approximate center coordinates
- ✅ States/Provinces: Administrative center coordinates
- ✅ Cities: City center coordinates
Are country and currency codes standardized?
Are country and currency codes standardized?
- ISO 3166-1 alpha-2 (2-letter codes like “US”, “GB”)
- ISO 3166-1 alpha-3 (3-letter codes like “USA”, “GBR”)
- ISO 4217 standard (3-letter codes like “USD”, “EUR”)
- ITU-T E.164 standard international calling codes
Integration & Development
Can I use this API with CORS from a browser application?
Can I use this API with CORS from a browser application?
- Server-side proxy: Create your own API endpoint that calls our API
- Serverless functions: Use services like Vercel Functions, Netlify Functions, or AWS Lambda
- Static site generation: Fetch data at build time for static sites
- API keys are visible in browser developer tools
- Risk of key theft and unauthorized usage
- Potential CORS restrictions
How do I handle cascading dropdowns (Country → State → City)?
How do I handle cascading dropdowns (Country → State → City)?
Complete Example
What's the best way to handle errors in my integration?
What's the best way to handle errors in my integration?
- Always check response status codes
- Implement retry logic for temporary failures
- Provide meaningful error messages to users
- Log errors for debugging purposes
Can I cache API responses locally?
Can I cache API responses locally?
- Countries: 24-48 hours (very stable data)
- States: 12-24 hours (occasionally updated)
- Cities: 6-12 hours (more frequently updated)
Troubleshooting
Why am I getting empty results for certain countries/states?
Why am I getting empty results for certain countries/states?
- Incorrect country/state codes: Verify you’re using the correct ISO codes
- Case sensitivity: Country codes should be uppercase (“US”, not “us”)
- State code format: Use 2-letter state codes when available
- Data availability: Some territories may have limited subdivision data
The API response seems slow. How can I improve performance?
The API response seems slow. How can I improve performance?
- Implement caching (most important)
- Use specific endpoints instead of filtering large datasets
- Parallel requests for independent data
- CDN/Edge caching for static geographical data
- Use HTTP/2 for multiplexed requests
- Implement connection pooling
- Add response compression
I'm seeing inconsistent data between requests. What's wrong?
I'm seeing inconsistent data between requests. What's wrong?
- Browser caching: Different cache states in development
- API versioning: Ensure you’re using the same API version
- Mixed endpoints: Don’t mix different API base URLs
- Concurrent updates: Our data is occasionally updated
How do I test my API integration?
How do I test my API integration?
- Start with cURL to verify basic connectivity
- Test each endpoint individually
- Verify error handling with invalid inputs
- Load test within your rate limits
Billing & Account
How does billing work for paid plans?
How does billing work for paid plans?
- Monthly billing cycle
- Usage resets on your billing date
- Overage protection available
- Multiple payment methods accepted
- Instant activation
- Prorated billing for upgrades
- Change or cancel anytime
- Real-time usage monitoring in your dashboard
- Email alerts for approaching limits
- Detailed usage analytics and reporting
View Pricing & Plans
Can I upgrade or downgrade my plan?
Can I upgrade or downgrade my plan?
- Immediate activation
- Higher rate limits available instantly
- Prorated billing for remainder of cycle
- Applied at next billing cycle
- Usage limits adjust accordingly
- Data access remains unchanged
- Log into your account dashboard
- Navigate to billing/subscription settings
- Select your new plan
- Confirm changes
What happens if I exceed my plan limits?
What happens if I exceed my plan limits?
- API requests are blocked until next billing cycle
- Account dashboard shows exceeded status
- Email notification sent when approaching and exceeding limits
- Requests return 429 status code
- Retry after specified time period
- No additional charges for rate limit hits
- Available on paid plans
- Automatic temporary limit increases
- Additional usage billed at standard rates