819e9802ea108ced159cab0059a82548:e4d4ec304ea57844608bb8f800b7d5768f1a64bcea25b4612cb5a7e6d8a16e606fe4c55d1440a3ee4207591b3cbf13b457dd04b57b736caf36d5e48cd58d930f3eb01ea433ca850ad8904f81d852124b
x-api-token in header. By using the RandomCoords APIs, you agree to the Terms and Conditions.Use curl on your system to test run the API:
curl -H "x-api-token: 819e9802ea108ced159cab0059a82548:e4d4ec304ea57844608bb8f800b7d5768f1a64bcea25b4612cb5a7e6d8a16e606fe4c55d1440a3ee4207591b3cbf13b457dd04b57b736caf36d5e48cd58d930f3eb01ea433ca850ad8904f81d852124b" \
https://api.randomcoords.com/v1/coordinates/countries/united-states?limit=5Or use one of RandomCoords libraries:
import RandomCoords from 'randomcoords';
const client = new RandomCoords({ apiToken: 'your-token' });
const coords = await client.getRegionCoordinates('asia', { limit: 5 });from randomcoords import RandomCoords
client = RandomCoords({"api_token": "your-token"})
coords = client.get_region_coordinates("asia", {"limit": 5})GET https://api.randomcoords.com/v1/coordinates/regions{
type: "regions";
results: number;
data: {
id: string;
name: string;
}[];
}GET https://api.randomcoords.com/v1/coordinates/regions/{region}?limit={number}Query Parameters: limit (optional, max 100, default 1)
{
id: string;
name: string;
type: "region";
results: number;
data: {
uid: string;
id: string;
country: string;
city: string;
state?: string;
iso2: string;
coordinates: [number, number];
}[];
}GET https://api.randomcoords.com/v1/coordinates/countries{
type: "countries";
results: number;
data: {
id: string;
name: string;
iso2: string;
}[];
}GET https://api.randomcoords.com/v1/coordinates/countries/{country}?limit={number}Query Parameters: limit (optional, max 100, default 1)
{
id: string;
name: string;
type: "country";
regions: string[];
iso2: string;
results: number;
data: {
uid: string;
city: string;
state?: string;
coordinates: [number, number];
}[];
}x-api-token header is missing.x-api-token is invalid or malformed.message field:{
message: string;
}This is a free, shared service. Please cache results where possible and avoid tight high-frequency loops. For production or high-volume use, get in touch at [email protected]