{
"status": "error",
"message": "Field \"type\" is not available on your current plan."
}
{
"error": "Unauthorized. You shouldn't be here."
}
{
"status": "error",
"message": "This feature is not available on your current plan.",
"details": {
"feature": "bulkStates",
"currentTier": "community",
"requiredTier": "starter",
"upgradeUrl": "https://countrystatecity.in/pricing"
}
}
{
"status": "error",
"message": "Field \"type\" is not available on your current plan."
}
{
"error": "Unauthorized. You shouldn't be here."
}
{
"status": "error",
"message": "This feature is not available on your current plan.",
"details": {
"feature": "bulkStates",
"currentTier": "community",
"requiredTier": "starter",
"upgradeUrl": "https://countrystatecity.in/pricing"
}
}
{
"error": "Daily usage limit exceeded. Please try again tomorrow or contact support for higher limits.",
"limit": 100,
"period": "daily",
"tier": "community",
"upgradeUrl": "https://countrystatecity.in/pricing"
}
County endpoints use the usual API key and count toward your request quota. Basic
lookups are available on every standard REST plan. Supporter+ adds coordinates,
source classification, population, translations and Wikidata fields.
Method
Path
Result
GET
/v1/countries/{country}/counties
All counties in the country
GET
/v1/countries/{country}/states/{state}/counties
Counties linked to that state
GET
/v1/countries/{country}/counties/{id}
One county, scoped to its country
GET
/v1/countries/{country}/counties/{id}/cities
Cities with that explicit source county link
Use an ISO2 country code (for example NZ) or numeric country ID. State paths use
the state’s code. County IDs must be positive safe integers. Unknown country,
state or county details return 404; a valid country/state with no counties
returns an empty array. REST lists return complete arrays, ordered by name then ID
unless you request another supported sort.
A county may have no single primary state. Preserve state_id: null and
state_code: null and use its states array, which contains every known source
membership as {id, name, code}. An empty array means no state link is recorded.
Filtering by one state still returns the complete membership array.For example, the source release installed on 24 November 2026 links Taupō
District (14024, New Zealand) to four states. It appears in all four state
lists; it is not duplicated within any one list. Do not assign it a primary state
based on the first array item. Source state/region terminology varies by country.
Fields and access
Access level
Fields
Basic (all standard plans)
id, name, country_id, country_code, state_id, state_code, states
Coordinates + translations, wikiDataId; localized_name and matched_locale when localization is requested
IDs and population counts are serialized as strings; coordinates are nullable
strings. Translations use the existing JSON-encoded string format. Use
?locale= and ?include_translations=true for localized output.?fields= and ?sort= require Starter+.
County sortable fields are id, name, country_code, state_code, type,
population, latitude and longitude, subject to your field access.
Substring search ?q= also requires Starter+ (2–100 characters) and matches
county names. Search, field selection and sort do not change the source membership array.
City responses at coordinates/full access include nullable county_id, including
city lists, nearby/fuzzy results and GraphQL. Basic city responses keep id,
name and kind. A missing county link stays null; the API does not infer it
from a city name, postcode or location.County city lists return the existing city shape with its tier rules and support
?kind=, eligible ?type=, ?q=, ?fields=, ?sort= and localization. A county
with no linked cities returns []. County coverage is country-dependent and not
an exhaustive worldwide administrative boundary service.Responses include ETag, X-Cache and Cache-Control; conditional requests with
If-None-Match can return 304. Data-only source updates refresh these caches
through the same geographic import process.
GraphQL
On Professional+ (or a custom plan with GraphQL enabled), use counties, county
and countyCities. Root lists default to 1,000 rows and support limit/offset;
County.states defaults to 20 items and accepts the same paging arguments.
The existing GraphQL resource budget applies.
{ county(country: "NZ", id: "14024") { id name state_id states { id name code } } countyCities(country: "NZ", county: "14024", limit: 10) { id name county_id }}
The change feed still tracks countries,
states and cities. City county_id participates in city snapshots on subsequent
publication; county entity changes are not included in that feed.
Case-insensitive substring match on the English name. Requires Starter+, 2–100 characters.
Required string length: 2 - 100
fields
string
Comma-separated list of fields to include in the response. id is always included. Requires Starter+ plan.
sort
string
County sort: id, name, country_code, state_code, type, population, latitude, longitude. Starter+; fields must be available on your data access level.
locale
string
BCP 47 locale code (e.g. pt-BR) to request a localized name. Adds localized_name (resolved via exact locale → base language → native name → English name fallback) and matched_locale (which tier matched) to each result; name is unaffected. Supporter+ plans only — silently omitted (not an error) on lower tiers. A malformed value is rejected with a 400 on every tier.
Required string length: 2 - 7
Pattern: ^[a-zA-Z]{2}(-[a-zA-Z]{2,4})?$
include_translations
boolean
default:false
When true, includes the full translations field (JSON string keyed by language code). Supporter+ plans only — silently omitted (not an error) on lower tiers. Note that an explicit fields=translations also returns the field and takes precedence over this flag.
Response
Get counties of a country
id
string
required
Pattern: ^[0-9]+$
Example:
"14024"
name
string
required
Example:
"Taupō District"
country_id
string
required
Pattern: ^[0-9]+$
country_code
string
required
Example:
"NZ"
states
object[]
required
Complete source state memberships, including on state-filtered results. Empty when no state link is known.
Show child attributes
state_id
string | null
Primary source state ID; can be null, including for counties spanning multiple states.
Pattern: ^[0-9]+$
state_code
string | null
Primary state code; preserve null instead of choosing the first state.
type
string | null
Coordinates/full access.
type_local
string | null
Coordinates/full access.
native
string | null
Coordinates/full access.
timezone
string | null
Coordinates/full access.
level
integer | null
Coordinates/full access.
parent_id
string | null
Coordinates/full access.
Pattern: ^[0-9]+$
population
string | null
Coordinates/full access.
Pattern: ^[0-9]+$
latitude
string | null
Numeric coordinate serialized as a string. Coordinates/full access.
longitude
string | null
Numeric coordinate serialized as a string. Coordinates/full access.
translations
string | null
Full access; localization/translation output follows the geographic endpoint query flags.
wikiDataId
string | null
Full access; localization/translation output follows the geographic endpoint query flags.
localized_name
string | null
Full access; localization/translation output follows the geographic endpoint query flags.
matched_locale
string | null
Full access; localization/translation output follows the geographic endpoint query flags.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Country State City Documentation","description":"Documentation for the Country State City ecosystem: a REST API, downloadable database and tools covering 250 countries, 5,000+ states and 150,000+ cities with ISO codes, coordinates, timezones and currencies.","colors":{"primary":"#2563EB","light":"#3B82F6","dark":"#1E40AF"},"logo":{"light":"https://mintcdn.com/webbywonder/DXb6lzT49e7Mz1Kh/logo/csc-docs-logo-dark.svg?fit=max\u0026auto=format\u0026n=DXb6lzT49e7Mz1Kh\u0026q=85\u0026s=893eeadd293f0443a7f2b192eb9b59d0","dark":"https://mintcdn.com/webbywonder/DXb6lzT49e7Mz1Kh/logo/csc-docs-logo-light.svg?fit=max\u0026auto=format\u0026n=DXb6lzT49e7Mz1Kh\u0026q=85\u0026s=cff7bfba805966e45c27a602c96e8252"},"favicon":"https://mintcdn.com/webbywonder/fAkIAEvO-IGHwy4I/favicon.svg?fit=max\u0026auto=format\u0026n=fAkIAEvO-IGHwy4I\u0026q=85\u0026s=1b0ea88bfb2dcdc3ed92888be25695ae","api":{"openapi":"https://raw.githubusercontent.com/dr5hn/csc-swagger-playground/dd657ccb7a781e1fa9a0bd89eeb81d7dc30d2836/config.json","playground":{"display":"interactive"},"mdx":{"auth":{"method":"key","name":"X-CSCAPI-KEY"},"server":"https://api.countrystatecity.in/v1"}},"navbar":{"links":[{"href":"https://countrystatecity.in","label":"Home"},{"href":"https://countrystatecity.in/pricing","label":"Pricing"},{"href":"https://countrystatecity.org","label":"Encyclopedia"}],"primary":{"type":"button","label":"Get API Key","href":"https://countrystatecity.in/product/api/"}},"footer":{"socials":{"github":"https://github.com/dr5hn/countries-states-cities-database","linkedin":"https://www.linkedin.com/in/dr5hn","x":"https://x.com/dr5hn"},"links":[{"header":"Products","items":[{"label":"REST API","href":"https://countrystatecity.in/product/api"},{"label":"Database","href":"https://countrystatecity.in/product/database"},{"label":"Export Tool","href":"https://export.countrystatecity.in/"},{"label":"Update Tool","href":"https://countrystatecity.in/product/update-tool"}]},{"header":"Resources","items":[{"label":"API Playground","href":"https://playground.countrystatecity.in/"},{"label":"Live Demo","href":"https://demo.countrystatecity.in/"},{"label":"Products","href":"https://countrystatecity.in/ecosystem"},{"label":"Changelog","href":"/changelog"},{"label":"Status","href":"https://status.countrystatecity.in/"}]},{"header":"Company","items":[{"label":"About","href":"https://countrystatecity.in/about"},{"label":"Pricing","href":"https://countrystatecity.in/pricing"},{"label":"Contact","href":"https://countrystatecity.in/contact"},{"label":"Encyclopedia","href":"https://countrystatecity.org/"}]}]},"search":{"prompt":"Search the documentation..."},"seo":{"metatags":{"og:site_name":"Country State City Docs","og:image":"https://docs.countrystatecity.in/images/hero-light.png","twitter:card":"summary_large_image","twitter:site":"@dr5hn","twitter:image":"https://docs.countrystatecity.in/images/hero-light.png","keywords":"country state city API, countries API, states API, cities API, ISO 3166, geographical database, location dropdown"}},"integrations":{"clarity":{"projectId":"z4ojfuzvou"},"ga4":{"measurementId":"G-7LDSKYGZJB"}},"banner":{"content":"[**MakeMySiteLive** Publish your website in under 2 minutes *New*](https://makemysitelive.com/?utm_source=csc-docs\u0026utm_medium=banner\u0026utm_campaign=cross-promo\u0026utm_content=makemysitelive) [**RemoteGigs** Find remote jobs and gigs](https://remotegig.in/?utm_source=csc-docs\u0026utm_medium=banner\u0026utm_campaign=cross-promo\u0026utm_content=remotegig)","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"webbywonder","hasAudioNarration":false,"actualSubdomain":"webbywonder","customDomains":["docs.countrystatecity.in"],"gitSource":{"type":"github","owner":"dr5hn","repo":"csc-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b057f0f669d462b6dbe51cb","clientVersion":"0.0.4286","searchFilterCounts":[{"language":"default","tag":"API Reference","count":32},{"language":"default","tag":"Database","count":14},{"language":"default","tag":"API Guides","count":13},{"language":"default","tag":"Tools","count":12},{"language":"default","tag":"Installation Guides","count":7},{"language":"default","tag":"SDKs \u0026 Examples","count":6},{"language":"default","tag":"Database Documentation","count":6},{"language":"default","tag":"Update Tool","count":6},{"language":"default","tag":"Regions","count":5},{"language":"default","tag":"Export Tool","count":5}],"searchSettings":{"showContentSnippets":true,"isFiltersEnabled":true,"maxResults":10}},"assistantConfig":{"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"deflection":{"enabled":true,"email":"[email protected]"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"#banner{background:#eef4fb;border-bottom:1px solid #dbe5f1;padding-top:6px;padding-bottom:6px}#banner>div{max-width:100%}#banner p{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:8px 12px;margin:0}#banner a{display:inline-flex;align-items:center;gap:8px;padding:4px 12px 4px 4px;background:#ffffff;border:1px solid #dbe5f1;border-radius:999px;flex:none;font-family:Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;font-size:13px;font-weight:400;text-decoration:none;white-space:nowrap;transition:box-shadow 0.15s ease, border-color 0.15s ease}#banner a:hover{border-color:#bcd0ea;box-shadow:0 1px 6px rgba(37, 99, 235, 0.15)}#banner a,#banner a *{-webkit-text-fill-color:#475569}#banner a [data-streamdown=\"strong\"]{white-space:nowrap;font-weight:600;-webkit-text-fill-color:#0f172a}#banner a::before{content:'';flex:none;width:24px;height:24px;background:no-repeat center / cover;border-radius:7px}#banner a:nth-of-type(1)::before{background-image:url('/images/makemysitelive-icon.png')}#banner a:nth-of-type(2)::before{background-image:url('/images/remotegigs-icon.png');border-radius:50%}#banner a::after{content:'';flex:none;width:12px;height:12px;background-color:#2563eb;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E\") no-repeat center / contain;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E\") no-repeat center / contain}#banner a em{padding:1px 8px;background:#fef3c7;border-radius:999px;font-size:11px;font-style:normal;font-weight:500;-webkit-text-fill-color:#92400e}#banner button{right:6px;opacity:0.6}#banner button:hover{opacity:1;background:rgba(15, 23, 42, 0.08)}#banner button svg path{stroke:#334155}@media (min-width: 901px) and (max-width: 1024px){#banner p{gap:8px;padding:0 40px}#banner a{gap:6px;padding:4px 10px 4px 4px;font-size:12.5px}}@media (min-width: 768px) and (max-width: 900px){#banner p{gap:6px;padding:0 32px}#banner a{gap:6px;padding:3px 10px 3px 3px;font-size:12px}#banner a::before{width:20px;height:20px}#banner a::after{width:10px;height:10px}#banner a em{display:none}}@media (max-width: 767px){#banner p{gap:6px;padding:0 28px}#banner a{font-size:0;gap:5px;padding:3px 8px 3px 3px}#banner a *:not([data-streamdown=\"strong\"]){font-size:0}#banner a [data-streamdown=\"strong\"]{font-size:12px}#banner a::before{width:20px;height:20px}#banner a::after{width:10px;height:10px}#banner a em{display:none}}@media (max-width: 400px){#banner a{gap:3px;padding-right:6px}#banner a [data-streamdown=\"strong\"]{font-size:11px}#banner a::after{display:none}}.dark #banner{background:#0f1b33;border-bottom-color:#1e2d4a}.dark #banner a{background:#16233f;border-color:#28395c}.dark #banner a,.dark #banner a *{-webkit-text-fill-color:#cbd5e1}.dark #banner a [data-streamdown=\"strong\"]{-webkit-text-fill-color:#f1f5f9}.dark #banner a::after{background-color:#60a5fa}.dark #banner a em{background:#3b2f0b;-webkit-text-fill-color:#fcd34d}.dark #banner button:hover{background:rgba(255, 255, 255, 0.1)}.dark #banner button svg path{stroke:#cbd5e1}"}]}
{"page":{"pagePath":"api/endpoints/get-counties","slug":"/api/endpoints/get-counties","pageMetadata":{"title":"County Lookups","openapi":"GET /countries/{ciso}/counties","description":"List counties by country or state, inspect a county and find its source-linked cities","icon":"map","href":"/api/endpoints/get-counties"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"List counties by country or state, inspect a county and find its source-linked cities\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`County endpoints use the usual API key and count toward your request quota. Basic\nlookups are available on every standard REST plan. Supporter+ adds coordinates,\nsource classification, population, translations and Wikidata fields.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Method`}),_jsx(_components.th,{children:`Path`}),_jsx(_components.th,{children:`Result`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GET`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/countries/{country}/counties`})}),_jsx(_components.td,{children:`All counties in the country`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GET`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/countries/{country}/states/{state}/counties`})}),_jsx(_components.td,{children:`Counties linked to that state`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GET`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/countries/{country}/counties/{id}`})}),_jsx(_components.td,{children:`One county, scoped to its country`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GET`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/countries/{country}/counties/{id}/cities`})}),_jsx(_components.td,{children:`Cities with that explicit source county link`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Use an ISO2 country code (for example `,_jsx(_components.code,{children:`NZ`}),`) or numeric country ID. State paths use\nthe state’s code. County IDs must be positive safe integers. Unknown country,\nstate or county details return `,_jsx(_components.code,{children:`404`}),`; a valid country/state with no counties\nreturns an empty array. REST lists return complete arrays, ordered by name then ID\nunless you request another supported sort.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.countrystatecity.in/v1/countries/NZ/counties/14024'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-CSCAPI-KEY: YOUR_API_KEY'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`counties-spanning-several-states`,children:`Counties spanning several states`}),`\n`,_jsxs(_components.p,{children:[`A county may have no single primary state. Preserve `,_jsx(_components.code,{children:`state_id: null`}),` and\n`,_jsx(_components.code,{children:`state_code: null`}),` and use its `,_jsx(_components.code,{children:`states`}),` array, which contains every known source\nmembership as `,_jsx(_components.code,{children:`{id, name, code}`}),`. An empty array means no state link is recorded.\nFiltering by one state still returns the complete membership array.`]}),`\n`,_jsxs(_components.p,{children:[`For example, the source release installed on 24 November 2026 links `,_jsx(_components.strong,{children:`Taupō\nDistrict`}),` (`,_jsx(_components.code,{children:`14024`}),`, New Zealand) to four states. It appears in all four state\nlists; it is not duplicated within any one list. Do not assign it a primary state\nbased on the first array item. Source state/region terminology varies by country.`]}),`\n`,_jsx(Heading,{level:`2`,id:`fields-and-access`,children:`Fields and access`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Access level`}),_jsx(_components.th,{children:`Fields`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Basic (all standard plans)`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`country_id`}),`, `,_jsx(_components.code,{children:`country_code`}),`, `,_jsx(_components.code,{children:`state_id`}),`, `,_jsx(_components.code,{children:`state_code`}),`, `,_jsx(_components.code,{children:`states`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Coordinates (custom plans)`}),_jsxs(_components.td,{children:[`Basic + `,_jsx(_components.code,{children:`type`}),`, `,_jsx(_components.code,{children:`type_local`}),`, `,_jsx(_components.code,{children:`level`}),`, `,_jsx(_components.code,{children:`parent_id`}),`, `,_jsx(_components.code,{children:`latitude`}),`, `,_jsx(_components.code,{children:`longitude`}),`, `,_jsx(_components.code,{children:`native`}),`, `,_jsx(_components.code,{children:`population`}),`, `,_jsx(_components.code,{children:`timezone`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Full (Supporter+)`}),_jsxs(_components.td,{children:[`Coordinates + `,_jsx(_components.code,{children:`translations`}),`, `,_jsx(_components.code,{children:`wikiDataId`}),`; `,_jsx(_components.code,{children:`localized_name`}),` and `,_jsx(_components.code,{children:`matched_locale`}),` when localization is requested`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`IDs and population counts are serialized as strings; coordinates are nullable\nstrings. Translations use the existing JSON-encoded string format. Use\n`,_jsxs(_components.a,{href:`/api/localization`,children:[_jsx(_components.code,{children:`?locale=`}),` and `,_jsx(_components.code,{children:`?include_translations=true`})]}),` for localized output.`]}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.a,{href:`/api/field-filtering-and-sorting`,children:[_jsx(_components.code,{children:`?fields=`}),` and `,_jsx(_components.code,{children:`?sort=`})]}),` require Starter+.\nCounty sortable fields are `,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`country_code`}),`, `,_jsx(_components.code,{children:`state_code`}),`, `,_jsx(_components.code,{children:`type`}),`,\n`,_jsx(_components.code,{children:`population`}),`, `,_jsx(_components.code,{children:`latitude`}),` and `,_jsx(_components.code,{children:`longitude`}),`, subject to your field access.\nSubstring search `,_jsx(_components.code,{children:`?q=`}),` also requires Starter+ (2–100 characters) and matches\ncounty names. Search, field selection and sort do not change the source membership array.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.countrystatecity.in/v1/countries/US/counties?fields=name,state_code\u0026sort=name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-CSCAPI-KEY: YOUR_API_KEY'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`city-relationships`,children:`City relationships`}),`\n`,_jsxs(_components.p,{children:[`City responses at coordinates/full access include nullable `,_jsx(_components.code,{children:`county_id`}),`, including\ncity lists, nearby/fuzzy results and GraphQL. Basic city responses keep `,_jsx(_components.code,{children:`id`}),`,\n`,_jsx(_components.code,{children:`name`}),` and `,_jsx(_components.code,{children:`kind`}),`. A missing county link stays `,_jsx(_components.code,{children:`null`}),`; the API does not infer it\nfrom a city name, postcode or location.`]}),`\n`,_jsxs(_components.p,{children:[`County city lists return the existing city shape with its tier rules and support\n`,_jsx(_components.code,{children:`?kind=`}),`, eligible `,_jsx(_components.code,{children:`?type=`}),`, `,_jsx(_components.code,{children:`?q=`}),`, `,_jsx(_components.code,{children:`?fields=`}),`, `,_jsx(_components.code,{children:`?sort=`}),` and localization. A county\nwith no linked cities returns `,_jsx(_components.code,{children:`[]`}),`. County coverage is country-dependent and not\nan exhaustive worldwide administrative boundary service.`]}),`\n`,_jsxs(_components.p,{children:[`Responses include `,_jsx(_components.code,{children:`ETag`}),`, `,_jsx(_components.code,{children:`X-Cache`}),` and `,_jsx(_components.code,{children:`Cache-Control`}),`; conditional requests with\n`,_jsx(_components.code,{children:`If-None-Match`}),` can return `,_jsx(_components.code,{children:`304`}),`. Data-only source updates refresh these caches\nthrough the same geographic import process.`]}),`\n`,_jsx(Heading,{level:`2`,id:`graphql`,children:`GraphQL`}),`\n`,_jsxs(_components.p,{children:[`On Professional+ (or a custom plan with GraphQL enabled), use `,_jsx(_components.code,{children:`counties`}),`, `,_jsx(_components.code,{children:`county`}),`\nand `,_jsx(_components.code,{children:`countyCities`}),`. Root lists default to 1,000 rows and support `,_jsx(_components.code,{children:`limit`}),`/`,_jsx(_components.code,{children:`offset`}),`;\n`,_jsx(_components.code,{children:`County.states`}),` defaults to 20 items and accepts the same paging arguments.\nThe existing `,_jsx(_components.a,{href:`/api/graphql#query-budget`,children:`GraphQL resource budget`}),` applies.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`graphql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`graphql`,children:_jsxs(_components.code,{language:`graphql`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` county`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`country`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"NZ\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"14024\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` state_id`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` states`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` countyCities`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`country`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"NZ\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`county`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"14024\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` county_id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/api/endpoints/get-data-changes`,children:`change feed`}),` still tracks countries,\nstates and cities. City `,_jsx(_components.code,{children:`county_id`}),` participates in city snapshots on subsequent\npublication; county entity changes are not included in that feed.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"County Lookups","openapi":"GET /countries/{ciso}/counties","description":"List counties by country or state, inspect a county and find its source-linked cities","icon":"map","href":"/api/endpoints/get-counties"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Counties spanning several states","slug":"counties-spanning-several-states","depth":2,"children":[]},{"title":"Fields and access","slug":"fields-and-access","depth":2,"children":[]},{"title":"City relationships","slug":"city-relationships","depth":2,"children":[]},{"title":"GraphQL","slug":"graphql","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"security":["705aeba0-3934-4b6f-bc6b-d4dfb3058a4c"],"tags":["Counties"],"summary":"Get counties of a country","operationId":"getCountryCounties","description":"List counties by country or state, inspect a county and find its source-linked cities","parameters":["5341965f-ab2e-4b50-b450-58b87d7dc725","3d7c95f0-a9e6-4c97-8412-3df402fe4304","82efa94b-1ba5-4a4d-849a-b7eb5101bb57","afa8da1d-2cbe-4733-8be4-8bfad09bede6","51c0a00c-49f8-4beb-bc6a-68f066eccd17","9ff621b8-44d2-41b8-88aa-dd2ea51841ee"],"responses":{"200":"005f32f0-a317-4bb3-83e7-38127e9346a5","400":"ce2e7bc8-beba-4bd4-840f-3a15eab73de3","401":"1d28901e-1a4d-4bd7-b2d2-e9c62ed9239e","403":"62be4ac1-22fb-4939-93e2-4f38ec6d83de","404":"20f7c712-2440-48d7-a6ac-8ea92189d03c","429":"dc2355f8-dc7c-4d57-b1cf-7fea995796e6"},"method":"get","type":"path","servers":["380d35c0-ef0e-4623-876b-78ec19ef05bd"],"path":"/countries/{ciso}/counties","baseUrlOptions":["https://api.countrystatecity.in/v1"],"title":"Get counties of a country","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"5341965f-ab2e-4b50-b450-58b87d7dc725":{"name":"ciso","in":"path","description":"ISO2 country code or numeric country ID.","required":true,"schema":{"type":"string","example":"NZ","isRequired":true,"description":"ISO2 country code or numeric country ID.","uniqueKey":"","typeLabel":"string"}},"3d7c95f0-a9e6-4c97-8412-3df402fe4304":{"name":"q","in":"query","description":"Case-insensitive substring match on the English name. Requires Starter+, 2–100 characters.","required":false,"schema":{"type":"string","minLength":2,"maxLength":100,"isRequired":false,"description":"Case-insensitive substring match on the English name. Requires Starter+, 2–100 characters.","uniqueKey":"","typeLabel":"string"}},"82efa94b-1ba5-4a4d-849a-b7eb5101bb57":{"name":"fields","in":"query","description":"Comma-separated list of fields to include in the response. `id` is always included. **Requires Starter+ plan.**","required":false,"schema":{"type":"string","isRequired":false,"description":"Comma-separated list of fields to include in the response. `id` is always included. **Requires Starter+ plan.**","uniqueKey":"","typeLabel":"string"}},"afa8da1d-2cbe-4733-8be4-8bfad09bede6":{"name":"sort","in":"query","description":"County sort: id, name, country_code, state_code, type, population, latitude, longitude. Starter+; fields must be available on your data access level.","required":false,"schema":{"type":"string","isRequired":false,"description":"County sort: id, name, country_code, state_code, type, population, latitude, longitude. Starter+; fields must be available on your data access level.","uniqueKey":"","typeLabel":"string"}},"51c0a00c-49f8-4beb-bc6a-68f066eccd17":{"name":"locale","in":"query","description":"BCP 47 locale code (e.g. `pt-BR`) to request a localized name. Adds `localized_name` (resolved via exact locale → base language → native name → English name fallback) and `matched_locale` (which tier matched) to each result; `name` is unaffected. **Supporter+ plans only** — silently omitted (not an error) on lower tiers. A malformed value is rejected with a `400` on every tier.","required":false,"schema":{"type":"string","minLength":2,"maxLength":7,"pattern":"^[a-zA-Z]{2}(-[a-zA-Z]{2,4})?$","isRequired":false,"description":"BCP 47 locale code (e.g. `pt-BR`) to request a localized name. Adds `localized_name` (resolved via exact locale → base language → native name → English name fallback) and `matched_locale` (which tier matched) to each result; `name` is unaffected. **Supporter+ plans only** — silently omitted (not an error) on lower tiers. A malformed value is rejected with a `400` on every tier.","uniqueKey":"","typeLabel":"string"}},"9ff621b8-44d2-41b8-88aa-dd2ea51841ee":{"name":"include_translations","in":"query","description":"When `true`, includes the full `translations` field (JSON string keyed by language code). **Supporter+ plans only** — silently omitted (not an error) on lower tiers. Note that an explicit `fields=translations` also returns the field and takes precedence over this flag.","required":false,"schema":{"type":"boolean","default":false,"isRequired":false,"description":"When `true`, includes the full `translations` field (JSON string keyed by language code). **Supporter+ plans only** — silently omitted (not an error) on lower tiers. Note that an explicit `fields=translations` also returns the field and takes precedence over this flag.","uniqueKey":"","typeLabel":"boolean"}}},"responses":{"005f32f0-a317-4bb3-83e7-38127e9346a5":{"description":"Get counties of a country","headers":{"Cache-Control":{"description":"Cache directive","schema":{"type":"string","example":"public, max-age=3600"}},"ETag":{"description":"Entity tag for conditional requests (use with `If-None-Match`)","schema":{"type":"string","example":"\"a3f2b8c1d4e5f6a7b8c9d0e1f2a3b4c5\""}},"X-Cache":{"description":"Whether the response was served from cache","schema":{"type":"string","enum":["HIT","MISS"],"example":"HIT"}},"X-CSC-Plan":{"description":"Your current pricing tier","schema":{"type":"string","enum":["community","starter","supporter","professional","business","legacy","custom"],"example":"supporter"}},"X-CSC-Daily-Used":{"description":"Number of requests used today","schema":{"type":"integer","example":42}},"X-CSC-Daily-Limit":{"description":"Your daily request limit (or 'unlimited' for custom plans)","schema":{"type":"string","example":"1000"}},"X-CSC-Monthly-Used":{"description":"Number of requests used this month","schema":{"type":"integer","example":850}},"X-CSC-Monthly-Limit":{"description":"Your monthly request limit (or 'unlimited' for custom plans)","schema":{"type":"string","example":"30000"}}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"Source county. Basic fields include identity, country/primary-state links and complete states membership. Geographic operational columns are never exposed.","required":["id","name","country_id","country_code","states"],"properties":{"id":{"type":"string","pattern":"^[0-9]+$","example":"14024","isRequired":true,"uniqueKey":"items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","example":"Taupō District","isRequired":true,"uniqueKey":"items.[INDEX].name","typeLabel":"string"},"country_id":{"type":"string","pattern":"^[0-9]+$","isRequired":true,"uniqueKey":"items.[INDEX].country_id","typeLabel":"string"},"country_code":{"type":"string","example":"NZ","isRequired":true,"uniqueKey":"items.[INDEX].country_code","typeLabel":"string"},"states":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"type":"string","pattern":"^[0-9]+$","isRequired":true,"uniqueKey":"items.[INDEX].states.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].states.items.[INDEX].name","typeLabel":"string"},"code":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].states.items.[INDEX].code.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"items.[INDEX].states.items.[INDEX].code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"items.[INDEX].states.items.[INDEX].code","typeLabel":"string | null"}},"uniqueKey":"items.[INDEX].states.items.[INDEX]","typeLabel":"object"},"description":"Complete source state memberships, including on state-filtered results. Empty when no state link is known.","isRequired":true,"uniqueKey":"items.[INDEX].states","typeLabel":"object[]"},"state_id":{"oneOf":[{"type":"string","pattern":"^[0-9]+$","description":"Primary source state ID; can be null, including for counties spanning multiple states.","uniqueKey":"items.[INDEX].state_id.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^[0-9]+$","description":"Primary source state ID; can be null, including for counties spanning multiple states.","uniqueKey":"items.[INDEX].state_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].state_id","typeLabel":"string | null"},"state_code":{"oneOf":[{"type":"string","description":"Primary state code; preserve null instead of choosing the first state.","uniqueKey":"items.[INDEX].state_code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Primary state code; preserve null instead of choosing the first state.","uniqueKey":"items.[INDEX].state_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].state_code","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].type.oneOf.0","typeLabel":"string"},{"type":"null","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].type.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].type","typeLabel":"string | null"},"type_local":{"oneOf":[{"type":"string","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].type_local.oneOf.0","typeLabel":"string"},{"type":"null","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].type_local.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].type_local","typeLabel":"string | null"},"native":{"oneOf":[{"type":"string","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].native.oneOf.0","typeLabel":"string"},{"type":"null","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].native.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].native","typeLabel":"string | null"},"timezone":{"oneOf":[{"type":"string","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].timezone.oneOf.0","typeLabel":"string"},{"type":"null","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].timezone.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].timezone","typeLabel":"string | null"},"level":{"oneOf":[{"type":"integer","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].level.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].level.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].level","typeLabel":"integer | null"},"parent_id":{"oneOf":[{"type":"string","pattern":"^[0-9]+$","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].parent_id.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^[0-9]+$","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].parent_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].parent_id","typeLabel":"string | null"},"population":{"oneOf":[{"type":"string","pattern":"^[0-9]+$","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].population.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^[0-9]+$","description":"Coordinates/full access.","uniqueKey":"items.[INDEX].population.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].population","typeLabel":"string | null"},"latitude":{"oneOf":[{"type":"string","description":"Numeric coordinate serialized as a string. Coordinates/full access.","uniqueKey":"items.[INDEX].latitude.oneOf.0","typeLabel":"string"},{"type":"null","description":"Numeric coordinate serialized as a string. Coordinates/full access.","uniqueKey":"items.[INDEX].latitude.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].latitude","typeLabel":"string | null"},"longitude":{"oneOf":[{"type":"string","description":"Numeric coordinate serialized as a string. Coordinates/full access.","uniqueKey":"items.[INDEX].longitude.oneOf.0","typeLabel":"string"},{"type":"null","description":"Numeric coordinate serialized as a string. Coordinates/full access.","uniqueKey":"items.[INDEX].longitude.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].longitude","typeLabel":"string | null"},"translations":{"oneOf":[{"type":"string","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].translations.oneOf.0","typeLabel":"string"},{"type":"null","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].translations.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].translations","typeLabel":"string | null"},"wikiDataId":{"oneOf":[{"type":"string","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].wikiDataId.oneOf.0","typeLabel":"string"},{"type":"null","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].wikiDataId.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].wikiDataId","typeLabel":"string | null"},"localized_name":{"oneOf":[{"type":"string","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].localized_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].localized_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].localized_name","typeLabel":"string | null"},"matched_locale":{"oneOf":[{"type":"string","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].matched_locale.oneOf.0","typeLabel":"string"},{"type":"null","description":"Full access; localization/translation output follows the geographic endpoint query flags.","uniqueKey":"items.[INDEX].matched_locale.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].matched_locale","typeLabel":"string | null"}},"uniqueKey":"items.[INDEX]","typeLabel":"object"},"uniqueKey":"","typeLabel":"object[]"},"examples":{"Example":{"title":"Example","value":[{"id":"14024","name":"Taupō District","country_id":"\u003cstring>","country_code":"NZ","states":[{"id":"\u003cstring>","name":"\u003cstring>","code":"\u003cstring>"}],"state_id":"\u003cstring>","state_code":"\u003cstring>","type":"\u003cstring>","type_local":"\u003cstring>","native":"\u003cstring>","timezone":"\u003cstring>","level":123,"parent_id":"\u003cstring>","population":"\u003cstring>","latitude":"\u003cstring>","longitude":"\u003cstring>","translations":"\u003cstring>","wikiDataId":"\u003cstring>","localized_name":"\u003cstring>","matched_locale":"\u003cstring>"}]}},"exampleType":"generated"}},"exampleType":"generated"},"ce2e7bc8-beba-4bd4-840f-3a15eab73de3":{"description":"Invalid `kind` value, or `type` used on a plan below Supporter","content":{"application/json":{"schema":{"type":"object","description":"Error envelope used by the postcode and meta endpoints.","properties":{"status":{"type":"string","example":"error","isRequired":true,"uniqueKey":"status","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"details":{"oneOf":[{"type":"object","properties":{"reason":{"type":"string","description":"Machine-readable reason. Check this instead of parsing `message`.","uniqueKey":"details.oneOf.0.reason","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"details.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"reason":{"type":"string","description":"Machine-readable reason. Check this instead of parsing `message`."}},"additionalProperties":true,"uniqueKey":"details.oneOf.1","typeLabel":"null"}],"uniqueKey":"details","typeLabel":"object | null"}},"required":["status","message"],"uniqueKey":"","typeLabel":"object"},"example":{"status":"error","message":"Field \"type\" is not available on your current plan."},"examples":{"Example":{"title":"Example","value":{"status":"error","message":"Field \"type\" is not available on your current plan."}}},"exampleType":"examples"}},"exampleType":"examples"},"1d28901e-1a4d-4bd7-b2d2-e9c62ed9239e":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"example":{"error":"Unauthorized. You shouldn't be here."},"examples":{"Example":{"title":"Example","value":{"error":"Unauthorized. You shouldn't be here."}}},"exampleType":"examples"}},"exampleType":"examples"},"62be4ac1-22fb-4939-93e2-4f38ec6d83de":{"description":"Feature not available on your current plan. Upgrade to access this endpoint. `details.feature` names the denied feature and `details.requiredTier` the lowest plan that includes it (the example is for `/states`).","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["error"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"message":{"type":"string","example":"This feature is not available on your current plan.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"details":{"type":"object","properties":{"feature":{"type":"string","description":"The feature flag that was denied","example":"bulkStates","isRequired":true,"uniqueKey":"details.feature","typeLabel":"string"},"currentTier":{"type":"string","example":"community","isRequired":true,"uniqueKey":"details.currentTier","typeLabel":"string"},"requiredTier":{"oneOf":[{"type":"string","description":"Lowest plan that unlocks the feature; null when it cannot be determined","example":"starter","isRequired":true,"uniqueKey":"details.requiredTier.oneOf.0","typeLabel":"string"},{"type":"null","description":"Lowest plan that unlocks the feature; null when it cannot be determined","example":"starter","isRequired":true,"uniqueKey":"details.requiredTier.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"details.requiredTier","typeLabel":"string | null"},"upgradeUrl":{"type":"string","format":"uri","example":"https://countrystatecity.in/pricing","isRequired":true,"uniqueKey":"details.upgradeUrl","typeLabel":"string\u003curi>"}},"required":["feature","currentTier","requiredTier","upgradeUrl"],"isRequired":true,"uniqueKey":"details","typeLabel":"object"}},"required":["status","message","details"],"uniqueKey":"","typeLabel":"object"},"example":{"status":"error","message":"This feature is not available on your current plan.","details":{"feature":"bulkStates","currentTier":"community","requiredTier":"starter","upgradeUrl":"https://countrystatecity.in/pricing"}},"examples":{"Example":{"title":"Example","value":{"status":"error","message":"This feature is not available on your current plan.","details":{"feature":"bulkStates","currentTier":"community","requiredTier":"starter","upgradeUrl":"https://countrystatecity.in/pricing"}}}},"exampleType":"examples"}},"exampleType":"examples"},"20f7c712-2440-48d7-a6ac-8ea92189d03c":{"description":"Country, state or county not found. A valid parent with no matching list rows returns an empty array.","content":{"application/json":{"schema":{"type":"object","description":"Error envelope used by the postcode and meta endpoints.","properties":{"status":{"type":"string","example":"error","isRequired":true,"uniqueKey":"status","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"details":{"oneOf":[{"type":"object","properties":{"reason":{"type":"string","description":"Machine-readable reason. Check this instead of parsing `message`.","uniqueKey":"details.oneOf.0.reason","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"details.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"reason":{"type":"string","description":"Machine-readable reason. Check this instead of parsing `message`."}},"additionalProperties":true,"uniqueKey":"details.oneOf.1","typeLabel":"null"}],"uniqueKey":"details","typeLabel":"object | null"}},"required":["status","message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"error","message":"\u003cstring>","details":{"reason":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"dc2355f8-dc7c-4d57-b1cf-7fea995796e6":{"description":"Daily or monthly usage limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Daily usage limit exceeded. Please try again tomorrow or contact support for higher limits.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"limit":{"type":"integer","description":"Your plan's limit for the exceeded period","example":100,"uniqueKey":"limit","typeLabel":"integer"},"period":{"type":"string","enum":["daily","monthly"],"example":"daily","uniqueKey":"period","typeLabel":"enum\u003cstring>"},"tier":{"type":"string","description":"Your current tier","example":"community","uniqueKey":"tier","typeLabel":"string"},"upgradeUrl":{"type":"string","description":"URL to upgrade your plan","example":"https://countrystatecity.in/pricing","uniqueKey":"upgradeUrl","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"example":{"error":"Daily usage limit exceeded. Please try again tomorrow or contact support for higher limits.","limit":100,"period":"daily","tier":"community","upgradeUrl":"https://countrystatecity.in/pricing"},"examples":{"Example":{"title":"Example","value":{"error":"Daily usage limit exceeded. Please try again tomorrow or contact support for higher limits.","limit":100,"period":"daily","tier":"community","upgradeUrl":"https://countrystatecity.in/pricing"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"705aeba0-3934-4b6f-bc6b-d4dfb3058a4c":{"ApiKeyAuth":{"type":"apiKey","description":"API key for authentication. Get your free key at [app.countrystatecity.in](https://app.countrystatecity.in).","name":"X-CSCAPI-KEY","in":"header","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"380d35c0-ef0e-4623-876b-78ec19ef05bd":{"url":"https://api.countrystatecity.in/v1","description":"Production API"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","description":"API key for authentication. Get your free key at [app.countrystatecity.in](https://app.countrystatecity.in).","name":"X-CSCAPI-KEY","in":"header","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"X-CSCAPI-KEY","type":"string","description":"API key for authentication. Get your free key at [app.countrystatecity.in](https://app.countrystatecity.in).","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"X-CSCAPI-KEY"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"https://raw.githubusercontent.com/dr5hn/csc-swagger-playground/dd657ccb7a781e1fa9a0bd89eeb81d7dc30d2836/config.json"},"subdomain":"webbywonder","siteName":"Country State City Documentation","title":"County Lookups - Country State City Documentation","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"contextualStarterQuestions":[{"_id":"6b05798b3290aea3f7a8982b","deploymentId":"68c5124ba1ff923c83a9da5f","questionText":"What fields need Supporter+ access?","status":"active","generatedBy":"contextual","path":"api/endpoints/get-counties","createdAt":"2026-11-24T11:48:27.230Z","updatedAt":"2026-11-24T11:48:27.230Z","__v":0},{"_id":"6b05798b3290aea3f7a8982c","deploymentId":"68c5124ba1ff923c83a9da5f","questionText":"How do I get cities in a county?","status":"active","generatedBy":"contextual","path":"api/endpoints/get-counties","createdAt":"2026-11-24T11:48:27.230Z","updatedAt":"2026-11-24T11:48:27.230Z","__v":0},{"_id":"6b05798b3290aea3f7a8982a","deploymentId":"68c5124ba1ff923c83a9da5f","questionText":"How do I list counties by country?","status":"active","generatedBy":"contextual","path":"api/endpoints/get-counties","createdAt":"2026-11-24T11:48:27.230Z","updatedAt":"2026-11-24T11:48:27.230Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{},"searchTabScopes":[{"tab":"Home"},{"tab":"API Guides"},{"tab":"API Reference"},{"tab":"Tools"},{"tab":"Database"}]},"lastModified":"2026-11-24T11:48:24.710Z","originalFileLocation":"api/endpoints/get-counties.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"List counties by country or state, inspect a county and find its source-linked cities\">\u003cmeta data-mint-head name=\"keywords\" content=\"country state city API, countries API, states API, cities API, ISO 3166, geographical database, location dropdown\">\u003cmeta data-mint-head name=\"application-name\" content=\"Country State City Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"County Lookups - Country State City Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"List counties by country or state, inspect a county and find its source-linked cities\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Country State City Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.countrystatecity.in/api/endpoints/get-counties\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.countrystatecity.in/images/hero-light.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"County Lookups - Country State City Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"List counties by country or state, inspect a county and find its source-linked cities\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.countrystatecity.in/images/hero-light.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/webbywonder/QCoQSc7Hfg85lHKO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Country State City Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.countrystatecity.in/api/endpoints/get-counties\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/endpoints/get-counties.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.countrystatecity.in/#organization\",\"name\":\"Country State City Documentation\",\"url\":\"https://docs.countrystatecity.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/webbywonder/DXb6lzT49e7Mz1Kh/logo/csc-docs-logo-dark.svg?fit=max\u0026auto=format\u0026n=DXb6lzT49e7Mz1Kh\u0026q=85\u0026s=893eeadd293f0443a7f2b192eb9b59d0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.countrystatecity.in#website\",\"name\":\"Country State City Documentation\",\"url\":\"https://docs.countrystatecity.in\",\"publisher\":{\"@id\":\"https://docs.countrystatecity.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.countrystatecity.in/api/endpoints/get-counties#webpage\",\"url\":\"https://docs.countrystatecity.in/api/endpoints/get-counties\",\"name\":\"County Lookups\",\"description\":\"List counties by country or state, inspect a county and find its source-linked cities\",\"dateModified\":\"2026-11-24T11:48:24.710Z\",\"isPartOf\":{\"@id\":\"https://docs.countrystatecity.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.countrystatecity.in/api/endpoints/get-counties#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.countrystatecity.in/api/endpoints/get-counties#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Country State City Documentation\",\"item\":\"https://docs.countrystatecity.in\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"County Lookups\",\"item\":\"https://docs.countrystatecity.in/api/endpoints/get-counties\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.countrystatecity.in/api/endpoints/get-counties#apireference\",\"headline\":\"County Lookups\",\"name\":\"County Lookups\",\"description\":\"List counties by country or state, inspect a county and find its source-linked cities\",\"url\":\"https://docs.countrystatecity.in/api/endpoints/get-counties\",\"mainEntityOfPage\":{\"@id\":\"https://docs.countrystatecity.in/api/endpoints/get-counties#webpage\"},\"image\":\"https://docs.countrystatecity.in/images/hero-light.png\",\"dateModified\":\"2026-11-24T11:48:24.710Z\",\"publisher\":{\"@id\":\"https://docs.countrystatecity.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.countrystatecity.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Country State City Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Country State City Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/endpoints/get-counties.md","siteName":"Country State City Documentation","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"API Guides","icon":"book","pages":[{"title":"API Guides","href":"/api/introduction"}]},{"tab":"API Reference","icon":"code","groups":[{"group":"County Endpoints","pages":[{"title":"County Lookups","openapi":"GET /countries/{ciso}/counties","icon":"map","href":"/api/endpoints/get-counties"}]},{"group":"Countries","icon":"earth-americas","pages":[{"title":"Get All Countries","openapi":"GET /countries","description":"Retrieve a complete list of all countries with basic information","href":"/api/endpoints/get-all-countries"},{"title":"Get Country Details","openapi":"GET /countries/{ciso}","href":"/api/endpoints/get-country-details"}]},{"group":"States","icon":"map","pages":[{"title":"Get All States","openapi":"GET /states","href":"/api/endpoints/get-all-states"},{"title":"Get States by Country","openapi":"GET /countries/{ciso}/states","href":"/api/endpoints/get-states-by-country"},{"title":"Get State Details","openapi":"GET /countries/{ciso}/states/{siso}","href":"/api/endpoints/get-state-details"}]},{"group":"Cities","icon":"city","pages":[{"title":"Get Cities by Country","openapi":"GET /countries/{ciso}/cities","href":"/api/endpoints/get-cities-by-country"},{"title":"Get Cities by State","openapi":"GET /countries/{ciso}/states/{siso}/cities","href":"/api/endpoints/get-cities-by-state"}]},{"group":"Postcodes","icon":"envelope","pages":[{"title":"Get Postcode by Code","openapi":"GET /countries/{ciso}/postcodes/{code}","href":"/api/endpoints/get-postcode-by-code"},{"title":"Get Postcodes by Country","openapi":"GET /countries/{ciso}/postcodes","href":"/api/endpoints/get-postcodes-by-country"}]},{"group":"Regions","icon":"globe","pages":[{"title":"Get All Regions","openapi":"GET /regions","href":"/api/endpoints/get-all-regions"},{"title":"Get Region Details","openapi":"GET /regions/{id}","href":"/api/endpoints/get-region-details"},{"title":"Get Subregions by Region","openapi":"GET /regions/{id}/subregions","href":"/api/endpoints/get-subregions-by-region"},{"title":"Get Subregion Details","openapi":"GET /subregions/{id}","href":"/api/endpoints/get-subregion-details"},{"title":"Get Countries by Subregion","openapi":"GET /subregions/{id}/countries","href":"/api/endpoints/get-countries-by-subregion"}]},{"group":"Timezones","icon":"clock","pages":[{"title":"Get Timezone by Country","openapi":"GET /timezone/{ciso}","href":"/api/endpoints/get-timezone-by-country"},{"title":"Get Timezone by State","openapi":"GET /timezone/{ciso}/{siso}","href":"/api/endpoints/get-timezone-by-state"},{"title":"Get Timezone by City","openapi":"GET /timezone/{ciso}/{siso}/{city_id}","href":"/api/endpoints/get-timezone-by-city"}]},{"group":"Currencies","icon":"coins","pages":[{"title":"List All Currencies","openapi":"GET /currency","href":"/api/endpoints/list-all-currencies"},{"title":"Get Currency by Country","openapi":"GET /currency/{ciso}","href":"/api/endpoints/get-currency-by-country"}]},{"group":"Phone","icon":"phone","pages":[{"title":"List Dial Codes","openapi":"GET /phone","href":"/api/endpoints/list-dial-codes"},{"title":"Get Dial Code by Country","openapi":"GET /phone/{ciso}","href":"/api/endpoints/get-dial-code-by-country"},{"title":"Parse Phone Number","openapi":"GET /phone/parse","href":"/api/endpoints/parse-phone-number"}]},{"group":"ISO Codes","icon":"hashtag","pages":[{"title":"Lookup Country by ISO Code","openapi":"GET /iso/country","href":"/api/endpoints/lookup-country-by-iso"},{"title":"Lookup State by ISO Code","openapi":"GET /iso/state","href":"/api/endpoints/lookup-state-by-iso"},{"title":"Convert ISO Code","openapi":"GET /iso/country/convert","href":"/api/endpoints/convert-iso-code"}]},{"group":"Search","icon":"magnifying-glass","pages":[{"title":"Fuzzy Search","openapi":"GET /search/fuzzy","href":"/api/endpoints/fuzzy-search"},{"title":"Autocomplete","openapi":"GET /search/autocomplete","href":"/api/endpoints/get-search-autocomplete"},{"title":"Nearby Search","openapi":"GET /search/nearby","href":"/api/endpoints/get-search-nearby"}]},{"group":"Data Changes","icon":"code-compare","pages":[{"title":"Data Change Feed","openapi":"GET /changes","href":"/api/endpoints/get-data-changes"}]},{"group":"GraphQL API","icon":"diagram-project","pages":[{"title":"GraphQL API","api":"POST https://api.countrystatecity.in/v1/graphql","href":"/api/graphql"}]},{"group":"Meta","icon":"circle-info","pages":[{"title":"Get Data Version","openapi":"GET /meta/data-version","href":"/api/endpoints/get-data-version"}]}]},{"tab":"Tools","pages":[{"title":"Tools","href":"/tools/overview"}]},{"tab":"Database","pages":[{"title":"Database","href":"/database/overview"}]}]},"basePath":"","title":"County Lookups - Country State City Documentation","deploymentId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","buildId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-CoLHY196.js","dist-C-58LlaB.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-x4vGgoST.js","snippetPresets-BGlsYH49.js","utils-D225GpYB.js","style-to-object-BY3JEAdk.js","utils-fb7dxv-3.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-D0sNzoEe.js","conditional-requirements-CFM0id0Q.js","cloneDeep-C4iMfrOs.js","_Uint8Array-DDor1j2p.js","isObject-FP1Yky1u.js","ApiExamples-Bw_TWYoP.js","usePlaygroundInputsStore-DLRpNM_Z.js","shallow-DCZ_mvT2.js","isEqual-BZMHHGz2.js","CodeSnippets-CqYNT6UN.js","CodeSnippet-AsYrl7_f.js","getApiPlaygroundDisplay-B1HdZsAn.js","Page-COAeG2by.js","DynamicMarkdown-Bg54PExR.js","SectionHeading-BVOfbSTS.js","icon-Bwg0LftJ.js","MethodPill-ETXe5J4U.js","getPastedJson-6m1DH7UM.js","Check2Icon-Bz4v4IkN.js","axios-CsQoIw0U.js","Markdown-CYkmN8yk.js","AssistantPageLink-BZUrxqjy.js"]}