Locations

Finding countries, states, and cities for map generation.

Locations

Every map starts with a location. Use our MCP discovery endpoints to find the location ID you need.

Location Types

TypeDescriptionExamples
countrySovereign nationsUSA, Canada, Mexico
subdivisionStates, provinces, territoriesCalifornia, Ontario, Oaxaca
cityMajor citiesLos Angeles, Toronto

Discovering Locations

List Countries

curl 'https://api.smavatar.com/api/mcp/tools/list-locations?type=country'

Response:

{
  "success": true,
  "data": [
    {
      "id": "bdd56f14-e776-418a-ab18-89c8138df978",
      "name": "United States of America",
      "location_code": "us",
      "location_type": "country"
    },
    {
      "id": "fde40c8b-4d20-4839-960d-a7685ef3afc0",
      "name": "Canada",
      "location_code": "ca",
      "location_type": "country"
    }
  ]
}

List Subdivisions (States/Provinces)

# All subdivisions
curl 'https://api.smavatar.com/api/mcp/tools/list-locations?type=subdivision'

# Search for specific state
curl 'https://api.smavatar.com/api/mcp/tools/list-locations?type=subdivision&q=california'

Response:

{
  "success": true,
  "data": [
    {
      "id": "abc123-def456",
      "name": "California",
      "location_code": "us-ca",
      "location_type": "subdivision",
      "parent_location_id": "bdd56f14-e776-418a-ab18-89c8138df978"
    }
  ]
}

Get Location Details

curl 'https://api.smavatar.com/api/mcp/tools/get-location-details?id=bdd56f14-e776-418a-ab18-89c8138df978'

Response:

{
  "success": true,
  "data": {
    "id": "bdd56f14-e776-418a-ab18-89c8138df978",
    "name": "United States of America",
    "location_code": "us",
    "location_type": "country",
    "bounds": {
      "minLng": -179.15,
      "maxLng": -66.95,
      "minLat": 18.91,
      "maxLat": 71.35
    },
    "subdivisions_count": 50
  }
}

Location Codes

Location codes follow ISO standards:

FormatExampleDescription
{country}us, ca, mxISO 3166-1 alpha-2
{country}-{subdivision}us-ca, ca-onISO 3166-2

Common Location IDs

Here are frequently used location IDs:

Countries

CountryIDCode
United Statesbdd56f14-e776-418a-ab18-89c8138df978us
Canadafde40c8b-4d20-4839-960d-a7685ef3afc0ca
Mexico(check API)mx

US States

StateIDCode
California(check API)us-ca
Texas(check API)us-tx
New York(check API)us-ny
Florida(check API)us-fl
Idahode340a59-d8c3-419e-ba89-91c60c3335d8us-id
Always use the API to get current location IDs. IDs shown here are examples and may change.

Using Locations in Maps

Once you have a location ID, use it in your map request:

curl -X POST '.../jobs/maps' \
  -d '{
    "location_id": "bdd56f14-e776-418a-ab18-89c8138df978",
    "theme": "modern"
  }'

Subdivision Maps

To map a specific state/province:

# Get Idaho's location ID
curl 'https://api.smavatar.com/api/mcp/tools/list-locations?type=subdivision&q=idaho'

# Create Idaho map
curl -X POST '.../jobs/maps' \
  -d '{
    "location_id": "de340a59-d8c3-419e-ba89-91c60c3335d8",
    "theme": "modern"
  }'

Next Steps

Create Map

Use your location to generate a map.

Highlighting

Highlight specific regions on country maps.

Built with Nuxt UI • © 2025