Geo-IPルックアップAPI

任意のIPから都市、国、またはASN情報を絵文字フラグ付きで取得。

何ができますか?
正確な都市と座標

緯度、経度、地域などを1回の呼び出しで取得。

ASNとISPを即座に取得

任意のIPブロックの所有組織を特定。

絵文字フラグ、タイムゾーン、通貨

ロケールのパーソナライゼーションと分析に最適。

ライブで試す
99.9 % 稼働時間
84.5ms レスポンス
20 req/s
0.009 クレジット / リクエスト

City Lookup


POST https://api.yeb.to/v1/geoip/city
パラメータ必須説明
api_key string はい Your API key
ip string 任意 IPv4/IPv6 (defaults to caller IP)

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"
}'

レスポンス例

{
  "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}

レスポンスコード

コード説明
200 Successリクエスト処理成功。
400 Bad Request入力バリデーション失敗。
401 UnauthorizedAPIキーが不足または不正。
403 Forbiddenキーが無効または許可されていません。
429 Rate Limitリクエストが多すぎます。
500 Server Error予期しないエラー。

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
パラメータ必須説明
api_key string はい Your API key
ip string 任意 IPv4/IPv6 (defaults to caller IP)

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"
}'

レスポンス例

{
  "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}

レスポンスコード

コード説明
200 Successリクエスト処理成功。
400 Bad Request入力バリデーション失敗。
401 UnauthorizedAPIキーが不足または不正。
403 Forbiddenキーが無効または許可されていません。
429 Rate Limitリクエストが多すぎます。
500 Server Error予期しないエラー。

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
パラメータ必須説明
api_key string はい Your API key
ip string 任意 IPv4/IPv6 (defaults to caller IP)

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"
}'

レスポンス例

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

レスポンスコード

コード説明
200 Successリクエスト処理成功。
400 Bad Request入力バリデーション失敗。
401 UnauthorizedAPIキーが不足または不正。
403 Forbiddenキーが無効または許可されていません。
429 Rate Limitリクエストが多すぎます。
500 Server Error予期しないエラー。

ASN

geoip/asn 0.0010 credits

Parameters

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

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Geo-IPルックアップAPI — 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.

よくある質問

MaxMind GeoLite2のデータは、世界中のIPv4アドレスの65〜70%に対して都市レベルの精度があります。

はい。エラーが発生したリクエストを含め、すべてのリクエストがクレジットを消費します。クレジットは成功・失敗に関係なくリクエスト数に紐づいています。エラーが明らかに当社のプラットフォーム側の問題による場合は、影響を受けたクレジットを復元します(現金での返金はありません)。

[email protected]までご連絡ください。フィードバックを真摯に受け止めています。バグレポートや機能リクエストが意味のあるものであれば、APIを迅速に修正・改善し、お礼として50の無料クレジットを付与します。

APIやエンドポイントによって異なります。一部のエンドポイントは外部ソースのデータを使用しており、より厳しい制限がある場合があります。また、不正利用の防止とプラットフォームの安定性維持のために制限を設けています。各エンドポイントの具体的な制限についてはドキュメントをご確認ください。

クレジットシステムで運営しています。クレジットは前払いの返金不可の単位で、API呼び出しやツールに使用します。クレジットはFIFO(古いものから順に)消費され、購入日から12か月間有効です。ダッシュボードに各購入日とその有効期限が表示されます。

はい。購入したすべてのクレジット(端数残高を含む)は購入から12か月間有効です。未使用のクレジットは有効期間終了時に自動的に期限切れとなり、永久に削除されます。期限切れのクレジットは復元や現金その他の価値への変換はできません。経過措置:2025年9月22日以前に購入したクレジットは2025年9月22日購入として扱われ、2026年9月22日に期限切れとなります(購入時により早い期限が記載されていない限り)。

はい—有効期間内で繰り越されます。未使用のクレジットは利用可能な状態のまま月ごとに繰り越され、購入後12か月で期限切れになります。

クレジットは返金不可です。必要な分だけ購入してください—後からいつでもチャージできます。プラットフォーム側のエラーで課金に失敗した場合、調査後に影響を受けたクレジットを復元する場合があります。現金での返金はありません。

料金はドルではなくクレジットで設定されています。各エンドポイントには独自のコストがあります—上記の「クレジット / リクエスト」バッジをご覧ください。常に正確な支出額がわかります。
← APIに戻る