API e Kërkimit Geo-IP

Informacione mbi qytetin, vendin ose ASN nga çdo IP, me flamuj emoji.

Çfarë mund të bëni?
Qytet dhe koordinata të sakta

Gjerësi, gjatësi gjeografike, rajon e më shumë në një thirrje të vetme.

Merrni ASN dhe ISP menjëherë

Zbuloni organizatën pronare të çdo blloku IP.

Flamuj emoji, zonë orare dhe monedhë

Perfekt për personalizimin lokal dhe analitikën.

Provo drejtpërdrejt
99.9 % Koha aktive
84.5ms Përgjigje
20 req/s
0.009 Kredite / kërkesë

City Lookup


POST https://api.yeb.to/v1/geoip/city
ParametriLlojiI detyrueshëmPërshkrimi
api_key string po Your API key
ip string opsional IPv4/IPv6 (defaults to caller IP)

Shembull

curl -X POST https://api.yeb.to/v1/geoip/city \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "ip": "8.8.8.8"
}'

Shembull përgjigje

{
  "data": {
    "ip": "8.8.8.8",
    "hostname": "dns.google",
    "city": "Mountain View",
    "region": "California",
    "country": "US",
    "loc": "37.3860,-122.0840",
    "timezone": "America/Los_Angeles",
    "country_flag": "🇺🇸",
    "emoji": "🇺🇸"
  }
}
{"error":"GeoIP lookup failed: invalid IP","code":422}

Kodet e përgjigjes

KodiPërshkrimi
200 SuccessKërkesa u përpunua me sukses.
400 Bad RequestVërtetimi i hyrjes dështoi.
401 UnauthorizedÇelësi API mungon / është i gabuar.
403 ForbiddenÇelësi joaktiv ose i palejuar.
429 Rate LimitShumë kërkesa.
500 Server ErrorDështim i papritur.

City

geoip/city 0.0090 credits

Parameters

API Key
query · string · required
IP address
query · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Country Lookup


POST https://api.yeb.to/v1/geoip/country
ParametriLlojiI detyrueshëmPërshkrimi
api_key string po Your API key
ip string opsional IPv4/IPv6 (defaults to caller IP)

Shembull

curl -X POST https://api.yeb.to/v1/geoip/country \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "ip": "1.1.1.1"
}'

Shembull përgjigje

{
  "ip": "1.1.1.1",
  "country": "AU",
  "country_name": "Australia",
  "isEU": false,
  "country_flag": "🇦🇺",
  "continent": { "code": "OC", "name": "Oceania" }
}
{"error":"GeoIP lookup failed: private range","code":422}

Kodet e përgjigjes

KodiPërshkrimi
200 SuccessKërkesa u përpunua me sukses.
400 Bad RequestVërtetimi i hyrjes dështoi.
401 UnauthorizedÇelësi API mungon / është i gabuar.
403 ForbiddenÇelësi joaktiv ose i palejuar.
429 Rate LimitShumë kërkesa.
500 Server ErrorDështim i papritur.

Country

geoip/country 0.0050 credits

Parameters

API Key
query · string · required
IP address
query · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

ASN Lookup


POST https://api.yeb.to/v1/geoip/asn
ParametriLlojiI detyrueshëmPërshkrimi
api_key string po Your API key
ip string opsional IPv4/IPv6 (defaults to caller IP)

Shembull

curl -X POST https://api.yeb.to/v1/geoip/asn \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "ip": "8.8.4.4"
}'

Shembull përgjigje

{
  "ip":  "8.8.4.4",
  "org": "Google LLC",
  "asn": 15169,
  "network": "8.8.4.0/24"
}
{"error":"GeoIP lookup failed: database missing","code":422}

Kodet e përgjigjes

KodiPërshkrimi
200 SuccessKërkesa u përpunua me sukses.
400 Bad RequestVërtetimi i hyrjes dështoi.
401 UnauthorizedÇelësi API mungon / është i gabuar.
403 ForbiddenÇelësi joaktiv ose i palejuar.
429 Rate LimitShumë kërkesa.
500 Server ErrorDështim i papritur.

ASN

geoip/asn 0.0010 credits

Parameters

API Key
query · string · required
IP address
query · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

API e Kërkimit Geo-IP — Practical Guide

A hands-on guide to GeoIP in production: what each endpoint does, when you’d use it, the few parameters that matter, and how to read responses to make real decisions (routing, compliance, personalization).

#What GeoIP solves

GeoIP helps you understand who’s connecting — network owner (ASN), country/region, and city-level signals — so you can do geo-based routing, regional compliance, personalization, and abuse controls without friction.

#Endpoints & when to use them

#POST /v1/geoip/asn — ASN Lookup

  • Best for: Network-level decisions (hosting vs ISP vs corporate), bot/automation heuristics, traffic shaping.
  • Output: asn (number), org (owner), and the network CIDR.
  • Tip: Defaults to the caller IP if you don’t pass ip. Great for server-side middleware.

#POST /v1/geoip/country — Country Lookup

  • Best for: Legal gating (GDPR/EU, export controls), pricing localization, content availability.
  • Output: ISO country code + name, isEU, and a continent object.
  • Tip: Keep it simple for edge workers; this is the fastest “allow/deny/route” decision.

#POST /v1/geoip/city — City Lookup

  • Best for: Timezone-aware UX, nearest-PoP routing, language defaults, coarse analytics.
  • Output: city, region, country, timezone, and loc (lat,lng).
  • Tip: Combine with CDN edge headers to avoid extra hops on hot paths.

#Quick start

# ASN
curl -X POST "https://api.yeb.to/v1/geoip/asn" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "ip": "8.8.4.4" }'
# Country
curl -X POST "https://api.yeb.to/v1/geoip/country" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "ip": "1.1.1.1" }'
# City
curl -X POST "https://api.yeb.to/v1/geoip/city" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "ip": "8.8.8.8" }'

#Parameters that actually matter

ParamTypeRequiredPractical guidance
api_key string Yes Your API credential. Prefer a server-side secret or signed edge token.
ip string No IPv4/IPv6. If omitted, the service uses the caller’s IP (handy for server-to-server requests).

#Reading & acting on responses

#ASN Lookup — interpretation

{
  "ip":  "8.8.4.4",
  "org": "Google LLC",
  "asn": 15169,
  "network": "8.8.4.0/24"
}
  • org — owner name you can show in admin/audit UIs.
  • asn — useful for allow/deny lists, bot heuristics, or prioritizing traffic from major ISPs/CDNs.
  • network — CIDR range to cache or apply rules on (rate-limits, exemptions).

#Country Lookup — interpretation

{
  "ip": "1.1.1.1",
  "country": "AU",
  "country_name": "Australia",
  "isEU": false,
  "country_flag": "🇦🇺",
  "continent": { "code": "OC", "name": "Oceania" }
}
  • country/country_name — drive content, taxes, or legal disclaimers.
  • isEU — immediate GDPR-related branching without maintaining your own country list.
  • continent — coarse routing or analytics bucketing.

#City Lookup — interpretation

{
  "data": {
    "ip": "8.8.8.8",
    "hostname": "dns.google",
    "city": "Mountain View",
    "region": "California",
    "country": "US",
    "loc": "37.3860,-122.0840",
    "timezone": "America/Los_Angeles",
    "country_flag": "🇺🇸",
    "emoji": "🇺🇸"
  }
}
  • timezone — default scheduling UI, email send windows, or cron-like tasks per user.
  • loc — approximate coordinates, good enough for nearest datacenter or store finder default.
  • hostname — sometimes reveals corporate/ISP hints helpful in fraud pipelines.

#Practical recipes

  • Compliance gating: If country.isEU → enable consent flows; if not, use lighter banners.
  • Routing: Resolve PoP by continent.code (e.g., NA/EU/APAC) and fall back to city if ambiguous.
  • Abuse control: Down-rank traffic from hosting ASNs during signup; boost residential ISPs.
  • UX defaults: Use timezone to pre-fill user settings; offer override in profile.

#API Changelog

2025-10-20
Improved IPv6 coverage and cleaner continent object for country responses; added hostname to city payload.
2025-10-12
Hardened proxy detection for “caller IP” mode and better 4xx messages on private/reserved ranges.
2025-10-05
Initial stable release of /geoip/asn, /geoip/country, and /geoip/city.

Pyetje të bëra shpesh

Të dhënat MaxMind GeoLite2 janë zakonisht të sakta në nivel qyteti për 65-70% të adresave IPv4 në mbarë botën.

Po. Çdo kërkesë, edhe ato që rezultojnë në gabime, konsumon kredite. Kreditet tuaja janë të lidhura me numrin e kërkesave, pavarësisht suksesit ose dështimit. Nëse gabimi shkaktohet qartë nga një problem i platformës në anën tonë, do të rivendosim kreditet e prekura (pa rimbursime në para të gatshme).

Na kontaktoni në [email protected]. I marrim komentet seriozisht—nëse raporti juaj i defektit ose kërkesa për veçori është e arsyeshme, mund ta rregullojmë ose përmirësojmë API-në shpejt dhe t'ju japim 50 kredite falas si faleminderit.

Varet nga API-ja dhe ndonjëherë edhe nga endpoint-i. Disa endpoint-e përdorin të dhëna nga burime të jashtme, të cilat mund të kenë kufij më të rreptë. Gjithashtu zbatojmë kufij për të parandaluar abuzimin dhe për të mbajtur platformën tonë të qëndrueshme. Kontrolloni dokumentacionin për kufirin specifik të çdo endpoint-i.

Operojmë me një sistem kreditesh. Kreditet janë njësi të parapaguara, jo të rimbursueshme që i shpenzoni në thirrje API dhe mjete. Kreditet konsumohen sipas FIFO (më të vjetrat së pari) dhe janë të vlefshme për 12 muaj nga data e blerjes. Paneli tregon çdo datë blerjeje dhe skadimin e saj.

Po. Të gjitha kreditet e blera (përfshirë balancat fraksionale) janë të vlefshme për 12 muaj nga blerja. Kreditet e papërdorura skadojnë automatikisht dhe fshihen përgjithmonë në fund të periudhës së vlefshmërisë. Kreditet e skaduara nuk mund të rivendosen ose konvertohen në para të gatshme ose vlerë tjetër. Rregulli kalimtar: kreditet e blera para 22 shtatorit 2025 trajtohen si të blera më 22 shtator 2025 dhe skadojnë më 22 shtator 2026 (përveç nëse një skadim më i hershëm u deklarua gjatë blerjes).

Po—brenda periudhës së tyre të vlefshmërisë. Kreditet e papërdorura mbeten të disponueshme dhe barten nga muaji në muaj derisa të skadojnë 12 muaj pas blerjes.

Kreditet janë jo të rimbursueshme. Blini vetëm atë që ju duhet—gjithmonë mund të rimbushni më vonë. Nëse një gabim i platformës shkakton një debitim të dështuar, mund të rivendosim kreditet e prekura pas hetimit. Asnjë rimbursim në para të gatshme.

Çmimet janë caktuar në kredite, jo në dollarë. Çdo endpoint ka koston e vet—shikoni stemën "Kredite / kërkesë" më lart. Gjithmonë do të dini saktësisht sa po shpenzoni.
← Kthehu te API-të