Skip to content
RoxyAPI
Get API Key

Location and Timezone API

City search that resolves a birthplace to coordinates and its timezone, even a small town or a city under its former name.

City Search · Geocoding · Timezone · Cities by Country

What the Location and Timezone API covers.

City search

  • Accent-insensitive autocomplete

  • Historic names such as Bombay and Peking

  • Every town and village, whatever its size

  • Qualify by state, province or country

Coordinates and timezone

  • Latitude and longitude for every place

  • IANA timezone on every result

  • DST-aware UTC offset

  • State or province and ISO country code

Country directory

  • Every country with its ISO codes

  • Searchable city coverage per country

  • Cities in a country sorted by population

Timezone and location API with city search and geocoding across 5,180,000+ cities, towns and villages in 240+ countries, returning latitude, longitude, IANA timezone, and DST-aware UTC offset. Coverage reaches every village on record, whatever its population, so a rural birthplace resolves as reliably as a capital. The location layer for birth chart forms, horoscope apps, event planners, and any feature that needs place-to-coordinates resolution. Fields map directly to the astrology endpoints, with no separate geocoding service to call or pay for. One key covers every RoxyAPI domain, with Remote MCP and typed SDKs.

Every Location and Timezone response is covered by 13,746 automated tests per deploy, checked against the IANA time zone database. See how we test.

Start your way. Code, agents or no code.

Developers

Typed SDKs for TypeScript, Python, PHP, C#, Go, and Rust, generated from the live spec, each with an AGENTS.md so your coding assistant calls the Location and Timezone API correctly.

AI agents

A Remote MCP server exposes every endpoint as a tool for Claude, ChatGPT, Cursor and any MCP client, with no local install. Opt-in compact responses cut the tokens your agent reads by roughly 40 to 52 percent, and one call stays one request.

No-code builders

Paste a widget into any site builder, install the WordPress plugin, or start from an MIT template you can white-label. Results render from the Location and Timezone API with no backend.

Location and Timezone API features, in detail.

The depth behind every line above, written out in full.

  • City autocomplete search across 5,180,000+ cities, towns and villages worldwide, ranked so a full name typed leads its smaller namesakes and a few letters reach the best-known city first
  • Every town and village on record, whatever its population, so a birthplace outside a metro area is not a dead end
  • A town name that matches nothing returns no match, never the largest town in the state or country it names, so a chart is never cast for a place the user did not type
  • Latitude, longitude, IANA timezone, and UTC offset in every result for direct use in astrology APIs
  • Global coverage across 240+ countries with ISO 3166 codes and state or province on every result
  • Historic and alternate city names resolve to the current place, so Bombay finds Mumbai, Peking finds Beijing, and a birthplace written under its former name still works
  • DST-aware UTC offset that adjusts automatically for daylight saving time
  • No separate geocoding service, so resolving a city never adds a third party call, a second bill, or someone else rate limiting your signup flow
  • Response fields map directly to astrology API parameters for seamless integration

Start building with one key.

Want to try without writing code? Try this domain live in API playground →

Terminal
npm install @roxyapi/sdk
Usage
import { createRoxy } from '@roxyapi/sdk'

const roxy = createRoxy(process.env.ROXY_API_KEY!)
const domain = roxy.location
SDK docs

Want to ship faster? Clone a free template and white-label it as your own app.

Building with Cursor, Claude Code, or Bolt? Use our AI prompts to generate a complete app.

Building on WordPress? Install the RoxyAPI plugin and drop a shortcode, no code required.

GET /api/v2/location/search?q=berlin
{
  "total": 502,
  "limit": 10,
  "offset": 0,
  "cities": [
    {
      "city": "Berlin",
      "province": "State of Berlin",
      "country": "Germany",
      "iso2": "DE",
      "latitude": 52.5244,
      "longitude": 13.4105,
      "timezone": "Europe/Berlin",
      "utcOffset": 1,
      "population": 3426354
    },
    {
      "city": "Berlin",
      "province": "Usulutan",
      "country": "El Salvador",
      "iso2": "SV",
      "latitude": 13.5,
      "longitude": -88.5333,
      "timezone": "America/El_Salvador",
      "utcOffset": -6,
      "population": 11313
    },
    {
      "city": "Berlin",
      "province": "New Hampshire",
      "country": "United States",
      "iso2": "US",
      "latitude": 44.4687,
      "longitude": -71.1851,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 9367
    },
    {
      "city": "Berlin",
      "province": "New Jersey",
      "country": "United States",
      "iso2": "US",
      "latitude": 39.7912,
      "longitude": -74.9291,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 7590
    },
    {
      "city": "Berlin",
      "province": "Wisconsin",
      "country": "United States",
      "iso2": "US",
      "latitude": 43.968,
      "longitude": -88.9434,
      "timezone": "America/Chicago",
      "utcOffset": -5,
      "population": 5420
    },
    {
      "city": "Berlin",
      "province": "Maryland",
      "country": "United States",
      "iso2": "US",
      "latitude": 38.3226,
      "longitude": -75.2177,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 5065
    },
    {
      "city": "North Canton",
      "province": "Ohio",
      "country": "United States",
      "iso2": "US",
      "latitude": 40.8759,
      "longitude": -81.4023,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 17441
    },
    {
      "city": "Berlin",
      "province": "Massachusetts",
      "country": "United States",
      "iso2": "US",
      "latitude": 42.3812,
      "longitude": -71.637,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 2422
    },
    {
      "city": "Berlin",
      "province": "Pennsylvania",
      "country": "United States",
      "iso2": "US",
      "latitude": 39.9206,
      "longitude": -78.9578,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 2019
    },
    {
      "city": "Brunswick",
      "province": "Maryland",
      "country": "United States",
      "iso2": "US",
      "latitude": 39.3143,
      "longitude": -77.6278,
      "timezone": "America/New_York",
      "utcOffset": -4,
      "population": 6116
    }
  ]
}

Structured JSON with documented fields. Not hallucinated text. See all endpoints

Drop-in UI components and no-code widgets.

Render Location and Timezone API responses without building charts yourself. Install the npm package and drop these into Next.js, React, Vue, Svelte, Angular, or plain HTML, or embed the very same component on Squarespace, Wix, or WordPress by pasting one snippet, with no backend and no build step. They belong to one library that covers the entire spiritual stack rather than astrology alone, MIT licensed and included in every plan at no extra cost, never a separate product and never an upsell. The Location and Timezone API calculations, the interface that renders them, and the Remote MCP your agent calls, all behind one key, end to end.

MIT licensedFramework agnosticThemeable via CSS variablesnpm or CDN
Show all Location and Timezone UI componentsShow fewer Location and Timezone UI components
ElementRenders
<roxy-location-search>Debounced city search input, emits roxy-location-select

Component preview

The real component, running on sample data.

Loading the component...

Free templates for Location and Timezone.

Clone. Edit. Ship. Free and open source by Team Roxy.

Browse all templates or use AI prompts to generate a custom app.

What you can build with the Location and Timezone API.

The products teams ship on the Location and Timezone API.

  • Birth chart location picker: autocomplete city search that auto-fills latitude, longitude, and timezone
  • Event location for transits: get coordinates and timezone for planetary transit and panchang calculations
  • Timezone conversion: look up IANA timezone and current UTC offset for any city worldwide
  • Country and city directory: browse all 240+ countries and their cities for location dropdowns and filters

Try every endpoint live, free, in the playground.

Real calls against the production API, no account needed. Every endpoint sits in the public OpenAPI spec and is callable as an MCP tool; open one for its parameters and response examples.

Search cities worldwide - Geocoding autocomplete with coordinates and timezone
Search cities worldwide - Geocoding autocomplete with coordinates and timezone

Turn a place name into coordinates, an IANA timezone and a DST-aware UTC offset, across 5,180,000+ cities, towns and villages in 240+ countries. Coverage reaches every village on record, whatever its population, so a birthplace outside a major metro resolves as reliably as a capital. Matching is case-insensitive, accent-insensitive and partial, so ber matches Berlin, Bern and Bergen, native scripts are transliterated, and historic names resolve to the current place, so bombay returns Mumbai and peking returns Beijing. A full name typed ranks above its smaller namesakes, a few letters reach the best-known city first, and a state, province or country in the query picks the right one of many places with the same name. A town name that matches nothing returns no match, never the largest town in the region it names. Built for birth chart location pickers, horoscope apps, event scheduling, and any feature that needs place-to-coordinates resolution.

List all countries - ISO codes and city coverage
List all countries - ISO codes and city coverage

Returns every country with ISO 3166-1 alpha-2 and alpha-3 codes, plus the number of searchable cities per country. Use this endpoint to build country dropdown menus, regional filters, or to check city coverage before querying a birth location. Countries are sorted alphabetically by name. Covers Europe, Americas, Asia, Middle East, Africa, and Oceania.

Get cities in a country - Geocoding directory sorted by population
Get cities in a country - Geocoding directory sorted by population

Returns all cities for a specific country, identified by ISO 3166-1 alpha-2 code (e.g. DE for Germany, FR for France, GB for United Kingdom, US for United States). Each city includes geographic coordinates, IANA timezone, and DST-aware UTC offset for direct use in astrology birth chart, horoscope, transit, and panchang calculations. Cities sorted by population with the largest metropolitan areas first.

Do not take our word for it. Ask the agents.

The receipts are public: the testing methodology, the open MIT benchmark, the transparency report, and the live API playground. Let ChatGPT, Perplexity, or Claude search the web and tell you what they find about RoxyAPI accuracy, MCP, SDKs, and pricing.

Opens a live web search in a new tab.

From your AI agent to a verified Location and Timezone answer.

Your AI agent

your model, your voice

Remote MCP

auto-discovered, no local setup

Token-optimized

Roxy Ephemeris

13,746 tests, 3647 gold standard

Verified result

18 domains, one flat rate

Your agent uses calculated charts and readings in its replies, with your model and your own voice. Planetary positions are verified against NASA JPL Horizons. No local setup, no AGPL, no hosted-AI markup.

Audit it yourself: every Location and Timezone endpoint runs live in the API playground

Location and Timezone API questions, answered.

How do I turn a birth city into latitude and longitude?

Send a city name to the location API and get back precise latitude and longitude in one call. The dataset covers 5,180,000+ cities, towns and villages across 240+ countries, down to the smallest village. A full name typed ranks above its smaller namesakes, and adding the state, province or country picks the right one of many places with the same name, so Springfield, Illinois resolves to Springfield, Illinois. This is city-level resolution built for birth and event forms, not street addresses. The coordinates drop straight into every birth chart, kundli, panchang, and forecast request, all under one API key with every RoxyAPI domain included at one flat price.

How do I get the correct IANA timezone for a birth place?

Every result from the location API carries the IANA timezone for that place, such as America/New_York, Europe/Berlin, or Australia/Sydney. That single value is what the chart and panchang endpoints need to anchor a reading to true local time. You can read it through the typed SDKs for TypeScript, Python, PHP, C#, Go, and Rust, or fetch it agent-side through our Remote MCP server with no local setup and no Docker. One lookup gives you coordinates and timezone together.

How does city autocomplete work for a birth data form?

Wire a text input to the location API and each keystroke returns ranked city matches for live typeahead. Typing ber surfaces Berlin, Bern, and Bergen, most likely first. Selecting one suggestion fills the entire location step at once: city, country, coordinates, and timezone. It is the setup layer that feeds the rest of the platform, and our drop-in UI components and WordPress plugin let you ship that picker without building it from scratch.

How do I handle daylight saving time in birth charts?

Pass the IANA timezone from the location API into any chart endpoint and daylight saving is handled for you. The chart endpoints resolve that identifier to the offset that was actually in effect on the birth date, so a January New York birth resolves correctly and a July birth does too. This removes the classic bug where a summer offset gets piped into a winter chart and quietly shifts every house. Accuracy at this layer is why one location call protects every downstream reading.

How do I build a country and city picker for global signups?

The location API ships a full directory: all 240+ countries with their ISO codes, plus the cities in each one with coordinates and timezone already attached. Use it to power country dropdowns and dependent city lists for a worldwide audience without sourcing or cleaning your own geo data. Activation is instant, so the directory is live the moment you get your key. The same directory is reachable through the typed SDKs and our Remote MCP server for AI agents.

Why use this instead of stitching together a separate geocoding service?

The location API is the front door to the whole RoxyAPI platform: the same key that resolves a city also runs every insight domain, from Western and Vedic astrology to numerology, tarot, and forecast. You get coordinates and timezone in the exact shape the chart endpoints expect, so there is no glue code between geocoding and calculation. Pricing is flat and predictable with no per-call geocoding bill, and discovery surfaces like AGENTS.md and llms.txt make the whole platform easy for agents to find and use.

Start using Location and Timezone API today.

City search that resolves a birthplace to coordinates and its timezone, even a small town or a city under its former name.

All 18 domains included with every plan. Every endpoint, MCP server, SDK, and templates.

Plans from $39/mo, starting at $1.80 per domain on annual billing. No credit card required for testing.

View Pricing & Get API Key