YepAPI
Reference

Location Codes

Country and city-level location codes for the SEO and SERP endpoints, and which markets have full keyword data versus search volume only.

Overview

All SEO API endpoints accept a location_code parameter to target a specific market. Pass a country code from the table below — or, on the endpoints listed under City and region targeting, a city or region code.

{
  "keywords": ["react framework"],
  "location_code": 2840,
  "language": "en"
}
Info

If you omit location_code, the API defaults to 2840 (United States). You can also pass a location string (e.g. "us") as a fallback, but location_code is recommended for precision and full coverage.

Language

language defaults to the location's main language (for example de for Germany, en for the United States). If you pass a language an endpoint doesn't serve for that location, the request isn't rejected: it runs with the location's default language instead.

City and region targeting

Two endpoints accept city- and region-level codes in the same location_code parameter, so you can localise below the country level:

EndpointWhat a city code changes
/v1/serp/googleResults are fetched as seen from that city — use it for local rank tracking.
/v1/seo/keywordsSearch volume, CPC and competition are for that city or region, not the country.
# Google results as seen from New York City
curl -X POST https://api.yepapi.com/v1/serp/google \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "plumber near me", "depth": 10, "location_code": 1023191}'

Find a location code

Search every supported location — about 270,000 countries, regions, cities, neighbourhoods and postal codes. Click a code to copy it.

Type at least two characters, or a country code to browse it.

"Works with" says where a code can be used: SERP for /v1/serp/google, Search volume for /v1/seo/keywords. Most locations support both.

The same lookup is available as a plain HTTP call, and the whole list as a file:

# Search: name and/or ISO country, optional type (City, Region, Postal Code, …)
curl "https://docs.yepapi.com/api/locations?q=austin&country=US&limit=5"

# Everything, tab-separated (2 MB gzipped): location_code, name, country, type, supports
curl -O https://docs.yepapi.com/data/locations.tsv.gz
{
  "ok": true,
  "total": 20,
  "results": [
    { "code": 1026201, "name": "Austin,Texas,United States", "country": "US", "type": "City", "serp": true, "volume": true }
  ]
}

On /v1/serp/google you can also skip the code and pass the location's name as location_name, or a point as coordinates.

Every other endpoint that takes location_code (keyword ideas, related keywords, difficulty, domain and competitor analytics) works at country level only.

Keyword data coverage

The Keyword data column says what is available for each country:

  • Full (94 markets) — search volume plus keyword difficulty, search intent, keyword ideas, related keywords, and the domain and competitor endpoints.
  • Volume only (121 markets) — /v1/seo/keywords returns search volume, CPC and competition. Difficulty, intent, ideas, related keywords and domain analytics are not available for these markets.

SERP endpoints work in every country listed.

Supported Location Codes

CountryISO CodeLocation CodeKeyword data
AfghanistanAF2004Volume only
AlbaniaAL2008Full
AlgeriaDZ2012Full
American SamoaAS2016Volume only
AndorraAD2020Volume only
AngolaAO2024Full
AntarcticaAQ2010Volume only
Antigua and BarbudaAG2028Volume only
ArgentinaAR2032Full
ArmeniaAM2051Full
AustraliaAU2036Full
AustriaAT2040Full
AzerbaijanAZ2031Full
BahrainBH2048Full
BangladeshBD2050Full
BarbadosBB2052Volume only
BelgiumBE2056Full
BelizeBZ2084Volume only
BeninBJ2204Volume only
BhutanBT2064Volume only
BoliviaBO2068Full
Bosnia and HerzegovinaBA2070Full
BotswanaBW2072Volume only
BrazilBR2076Full
BruneiBN2096Volume only
BulgariaBG2100Full
Burkina FasoBF2854Full
BurundiBI2108Volume only
Cabo VerdeCV2132Volume only
CambodiaKH2116Full
CameroonCM2120Full
CanadaCA2124Full
Caribbean NetherlandsBQ2535Volume only
Central African RepublicCF2140Volume only
ChadTD2148Volume only
ChileCL2152Full
ChinaCN2156Volume only
Christmas IslandCX2162Volume only
Cocos (Keeling) IslandsCC2166Volume only
ColombiaCO2170Full
ComorosKM2174Volume only
Cook IslandsCK2184Volume only
Costa RicaCR2188Full
Cote d'IvoireCI2384Full
CroatiaHR2191Full
CuracaoCW2531Volume only
CyprusCY2196Full
CzechiaCZ2203Full
Democratic Republic of the CongoCD2180Volume only
DenmarkDK2208Full
DjiboutiDJ2262Volume only
DominicaDM2212Volume only
Dominican RepublicDO2214Volume only
EcuadorEC2218Full
EgyptEG2818Full
El SalvadorSV2222Full
Equatorial GuineaGQ2226Volume only
EritreaER2232Volume only
EstoniaEE2233Full
EswatiniSZ2748Volume only
EthiopiaET2231Volume only
FijiFJ2242Volume only
FinlandFI2246Full
FranceFR2250Full
French PolynesiaPF2258Volume only
French Southern and Antarctic LandsTF2260Volume only
GabonGA2266Volume only
GeorgiaGE2268Volume only
GermanyDE2276Full
GhanaGH2288Full
GreeceGR2300Full
GrenadaGD2308Volume only
GuamGU2316Volume only
GuatemalaGT2320Full
GuernseyGG2831Volume only
GuineaGN2324Volume only
Guinea-BissauGW2624Volume only
GuyanaGY2328Volume only
HaitiHT2332Volume only
Heard Island and McDonald IslandsHM2334Volume only
HondurasHN2340Volume only
Hong KongHK2344Full
HungaryHU2348Full
IcelandIS2352Volume only
IndiaIN2356Full
IndonesiaID2360Full
IraqIQ2368Volume only
IrelandIE2372Full
Isle of ManIM2833Volume only
IsraelIL2376Full
ItalyIT2380Full
JamaicaJM2388Volume only
JapanJP2392Full
JerseyJE2832Volume only
JordanJO2400Full
KazakhstanKZ2398Full
KenyaKE2404Full
KiribatiKI2296Volume only
KuwaitKW2414Volume only
KyrgyzstanKG2417Volume only
LaosLA2418Volume only
LatviaLV2428Full
LebanonLB2422Volume only
LesothoLS2426Volume only
LiberiaLR2430Volume only
LibyaLY2434Volume only
LiechtensteinLI2438Volume only
LithuaniaLT2440Full
LuxembourgLU2442Volume only
MadagascarMG2450Volume only
MalawiMW2454Volume only
MalaysiaMY2458Full
MaldivesMV2462Volume only
MaliML2466Volume only
MaltaMT2470Full
Marshall IslandsMH2584Volume only
MauritaniaMR2478Volume only
MauritiusMU2480Volume only
MexicoMX2484Full
MicronesiaFM2583Volume only
MoldovaMD2498Full
MonacoMC2492Full
MongoliaMN2496Volume only
MontenegroME2499Volume only
MoroccoMA2504Full
MozambiqueMZ2508Volume only
Myanmar (Burma)MM2104Full
NamibiaNA2516Volume only
NauruNR2520Volume only
NepalNP2524Volume only
NetherlandsNL2528Full
New CaledoniaNC2540Volume only
New ZealandNZ2554Full
NicaraguaNI2558Full
NigerNE2562Volume only
NigeriaNG2566Full
NiueNU2570Volume only
Norfolk IslandNF2574Volume only
North MacedoniaMK2807Full
Northern Mariana IslandsMP2580Volume only
NorwayNO2578Full
OmanOM2512Volume only
PakistanPK2586Full
PalauPW2585Volume only
PanamaPA2591Full
Papua New GuineaPG2598Volume only
ParaguayPY2600Full
PeruPE2604Full
PhilippinesPH2608Full
Pitcairn IslandsPN2612Volume only
PolandPL2616Full
PortugalPT2620Full
QatarQA2634Volume only
Republic of the CongoCG2178Volume only
RomaniaRO2642Full
RwandaRW2646Volume only
Saint Helena, Ascension and Tristan da CunhaSH2654Volume only
Saint Kitts and NevisKN2659Volume only
Saint LuciaLC2662Volume only
Saint MartinMF2663Volume only
Saint Pierre and MiquelonPM2666Volume only
Saint Vincent and the GrenadinesVC2670Volume only
SamoaWS2882Volume only
San MarinoSM2674Volume only
Sao Tome and PrincipeST2678Volume only
Saudi ArabiaSA2682Full
SenegalSN2686Full
SerbiaRS2688Full
SeychellesSC2690Volume only
Sierra LeoneSL2694Volume only
SingaporeSG2702Full
Sint MaartenSX2534Volume only
SlovakiaSK2703Full
SloveniaSI2705Full
Solomon IslandsSB2090Volume only
SomaliaSO2706Volume only
South AfricaZA2710Full
South Georgia and the South Sandwich IslandsGS2239Volume only
South KoreaKR2410Full
SpainES2724Full
Sri LankaLK2144Full
SurinameSR2740Volume only
SwedenSE2752Full
SwitzerlandCH2756Full
TaiwanTW2158Full
TajikistanTJ2762Volume only
TanzaniaTZ2834Volume only
ThailandTH2764Full
The BahamasBS2044Volume only
The GambiaGM2270Volume only
Timor-LesteTL2626Volume only
TogoTG2768Volume only
TokelauTK2772Volume only
TongaTO2776Volume only
Trinidad and TobagoTT2780Volume only
TunisiaTN2788Full
TurkiyeTR2792Full
TurkmenistanTM2795Volume only
TuvaluTV2798Volume only
UgandaUG2800Volume only
UkraineUA2804Full
United Arab EmiratesAE2784Full
United KingdomGB2826Full
United StatesUS2840Full
United States Minor Outlying IslandsUM2581Volume only
UruguayUY2858Full
UzbekistanUZ2860Volume only
VanuatuVU2548Volume only
Vatican CityVA2336Volume only
VenezuelaVE2862Full
VietnamVN2704Full
Wallis and FutunaWF2876Volume only
YemenYE2887Volume only
ZambiaZM2894Volume only
ZimbabweZW2716Volume only

Endpoints That Use Location Codes

All of the following endpoints accept location_code:

On this page