Skip to content
Developers

API & CLI

Everything ipc.moe knows about an IP, one request away. No sign-up, no API key — plain text in your terminal, JSON for your code, SVG cards for your pages.

Terminal
curl ipc.moe
203.0.113.42

Works with curl, wget, HTTPie, PowerShell and any HTTP library. Requests that don't ask for HTML get plain text.

Quick start

Copy, paste, done.

  • Your IP onlycurl ipc.moe
  • Full report, pretty textcurl ipc.moe/r
  • Full report as JSONcurl ipc.moe/json
  • Look up any IPcurl ipc.moe/1.1.1.1

Command line

Made for the terminal

Any client whose Accept header doesn't include text/html is treated as a command-line client and gets plain text, with ANSI colors for curl-like tools. Browsers get the same data formats at these exact paths.

Paths

A target is an IPv4 or IPv6 address, an AS number like AS13335, or a domain (resolved to its first A record).

PathReturnsExample
/ /ipYour public IP address, followed by a newline.curl ipc.moe
/{format}Your full report in that format.curl ipc.moe/json
/{field}A single value from your report, followed by a newline.curl ipc.moe/country
/{target}The pretty text report for that IP, AS number or domain.curl ipc.moe/1.1.1.1
/{target}/{format|field}A format or a single field, for that target.curl ipc.moe/github.com/score

Formats

Use them as /{format} or /{target}/{format}.

FormatOutput
jsonThe full report as JSON (same shape as the JSON API).
yaml or ymlThe full report as YAML.
xmlThe full report as XML.
csvA header row and one data row.
tsvSame as CSV, tab-separated.
tomlThe full report as TOML.
txt or textPlain-text report without colors.
report or rThe pretty text report with boxes and colors.
shortOne line: IP, location, network, score.
mdA Markdown report, ready to paste into an issue.
envKEY=value lines for shell scripts.
helpEvery path and parameter, right in your terminal.

Fields

Plain values, ideal for scripts and prompts.

FieldValueSample
countryCountry name (localized)Japan
ccISO 3166-1 country codeJP
cityCityTokyo
regionRegion or stateTokyo
asnAutonomous system numberAS4713
orgOrganizationNTT Communications
ispInternet service providerOCN
tzIANA time zoneAsia/Tokyo
locLatitude,longitude35.6895,139.6917
scoreHealth score, 0–10092
gradeGrade, A+ to DA+
typeIP typeresidential
nativenative, broadcast or unknownnative
ptrReverse DNS namep1234-ipoe.ocn.ne.jp

Query parameters

Work on every command-line response.

ParameterValuesDefaultDescription
langzh-Hans · zh-Hant · en · jaAccept-LanguageLanguage of the report and labels.
colorauto · always · neverautoANSI colors. auto turns them on for curl, wget, HTTPie and xh.
mask0 · 101 hides the last two IPv4 octets (or the last 80 bits of IPv6) and the city.
fieldsip,geo,score…—Comma-separated list of fields to keep. JSON, YAML and CSV only.
width<n>72Width of the text report, in columns.
ascii0 · 101 drops box-drawing characters and emoji, for old terminals and logs.

Examples

Quote URLs that contain ? or & so your shell leaves them alone.

Pretty report in Japanese, 100 columns wide

curl "ipc.moe/r?lang=ja&width=100"

Just your ASN

curl ipc.moe/asn

Another IP as JSON, only the fields you need

curl "ipc.moe/8.8.8.8/json?fields=ip,geo,score"

An autonomous system

curl ipc.moe/AS13335

A domain, as a one-line summary

curl ipc.moe/github.com/short

Safe for screenshots: masked, no colors, plain ASCII

curl "ipc.moe/r?mask=1&color=never&ascii=1"

With wget

wget -qO- ipc.moe

With PowerShell

irm ipc.moe/json

JSON API

A JSON API for everything

The same data that powers this site. Send lang to get human-readable text in your language; country names, verdicts and reasons come back localized.

Endpoints

Base URL https://ipc.moe/api/v1

HTTPS onlyJSON · UTF-8CORS * on GETNo API keylang = zh-Hans · zh-Hant · en · ja
MethodPathPurposeLimit
GET/api/v1/meYour IP, IP version and country code. Instant: no external lookups.—
GET/api/v1/report/{target}?lang=The full report for an IP, or self for yours. Answers within about 6 s; meta.partial is true when a source timed out.30/min
GET/api/v1/geo?ips=a,b,c&lang=Batch lookup of up to 50 IPs from local databases. Returns a GeoBrief per IP.60/min
POST/api/v1/ai/assess?lang=Per-service AI scores from live browser signals (exit IPs, time zone, languages, WebRTC and DNS resolvers).30/min
GET/api/v1/catalog?lang=AI services, split-test targets, STUN servers and connectivity targets used by the browser tests.—
GET/api/v1/status?lang=Live status summary of major online services.—
GET/api/v1/status/{slug}?lang=Status, components and recent incidents of one service.—
POST/api/v1/shareCreate a share snapshot (≤ 16 KB). Returns its id, url and a delete_token.10/min
GET/api/v1/share/{id}Read a share snapshot. 404 once it has expired (after 30 days).—
DELETE/api/v1/share/{id}Delete a snapshot you created. Send its delete token in the X-Delete-Token header.—
GET/api/v1/dnsleak/newStart a DNS leak test. Returns available: false until our own DNS servers are live.20/min
GET/api/v1/dnsleak/{id}Resolvers seen for a DNS leak test, with EDNS client subnet when present.20/min
GET/api/v1/stats/publicPublic totals: page views, visitors, reports served, since when.—
POST/api/v1/eventsAnonymous page-view batches from this website.Used by this site120/min
GET/api/v1/admin/stats?days=90Daily traffic statistics for the site owner.Admin only—

Examples

Pick an endpoint and a language. Every snippet is complete and runs as is.

GET /api/v1/report/{target}?lang=

The full report for an IP, or self for yours. Answers within about 6 s; meta.partial is true when a source timed out.

curl
curl -s "https://ipc.moe/api/v1/report/1.1.1.1?lang=en"

Report

Top-level fields of /api/v1/report. How the score works →

FieldTypeDescription
querystringWhat you asked for; self resolves to your IP.
ipstringThe IP address described.
version4 | 6IP version.
selfbooleantrue when the report is about the caller's own IP.
generated_atstringWhen the report was built (ISO 8601).
geoGeoCountry, region, city, coordinates, time zone and accuracy.
networkNetworkASN, AS name, organization, ISP, prefix, RIR, RPKI, PTR and abuse contact.
typeIPTypeResidential, mobile, business, education, government, hosting, CDN or unknown, with each source's vote.
nativeNativeNative or broadcast IP: registered country versus geolocated country.
flagsRecord<FlagKey, Flag>Proxy, VPN, Tor, relay, hosting, crawler, abuser, mobile, anycast and bogon, with sources. hint means only one source said so.
riskRiskBlocklist matches, DNSBL results, abuse and proxy scores, GreyNoise, and risky neighbors in the same /24.
exposureExposure | nullOpen ports, tags, known CVEs and hostnames from Shodan InternetDB.
sourcesGeoSource[]Every geolocation source side by side.
cn_sourcesCNSource[]Chinese-language databases such as ip2region.
scoreHealthScoreHealth score 0–100, grade, type cap and every item that changed it.
aiAIIPScore[]IP-only availability and risk for each AI service.
suitabilitySuitability[]How well the IP suits common uses.
summarystringOne-line verdict, localized.
tagsTag[]Localized labels shown under the IP.
metaMetaelapsed_ms, partial, sources_ok / sources_total, model and cached.

GeoBrief

One entry per IP in /api/v1/geo.

FieldTypeDescription
ipstringThe IP address.
country_codestringISO 3166-1 alpha-2.
countrystringCountry name, localized.
regionstringRegion or state.
citystringCity.
asnnumber | nullAS number, if known.
orgstringNetwork organization.
textstringReady-made one-line description, localized.

Errors

Every error has the same shape, with a 4xx or 5xx status. The message follows lang.

{
  "error": {
    "code": "invalid_target",
    "message": "…"
  }
}
CodeHTTPMeaning
bad_request400Malformed request or body.
invalid_target400Not a valid IP address.
private_target400Private, reserved or bogon address.
too_many_ips400More than 50 IPs in one geo request.
unauthorized401Missing or wrong credentials.
not_found404Unknown path, or the item doesn't exist or has expired.
too_large413Request body too large.
rate_limited429Too many requests. Wait for Retry-After seconds.
internal500Something broke on our side.
unavailable503Temporarily unavailable. Try again shortly.

Rate limits

Per client IP, as a token bucket that allows short bursts. Over the limit you get 429 with a Retry-After header, in seconds. Endpoints not listed have no dedicated limit.

  • 30per minReports
  • 60per minGeo batches
  • 30per minAI assessments
  • 10per minNew shares
  • 20per minDNS leak tests
  • 60per minCommand-line reports
  • 120per minCard images
429
HTTP/1.1 429 Too Many Requests
Retry-After: 2
Content-Type: application/json; charset=utf-8

{"error":{"code":"rate_limited","message":"…"}}

Cards

Embeddable IP cards

A self-contained SVG that works anywhere an image does — READMEs, forums, blogs, status pages. Use me for the viewer's own IP, or any IP address.

IP card for 1.1.1.1, glass style, standard size
/card/1.1.1.1.svg?style=glass&size=standard

Embed it

A fixed IP is cached for an hour; me cards are private and refresh every minute.

Markdown
![ipc.moe](https://ipc.moe/card/1.1.1.1.svg?style=glass)
HTML
<img src="https://ipc.moe/card/me.svg?style=glass&size=standard"
     width="560" height="240" alt="My IP · ipc.moe">

Parameters

GET /card/{target}.svg — target is me or an IP address.

ParameterValuesDefaultDescription
styleglass · minimal · terminal · neon · paper · animeglassVisual style. anime adds an AI-chan illustration.
themeauto · light · darkautoauto follows the viewer's light or dark mode inside the SVG.
sizebadge · compact · standard · wide · square · banner · social · w/hstandardPreset size, or set w (200–1600) and h (60–1600) yourself:badge 360×72 · compact 420×140 · standard 560×240 · wide 760×240 · square 420×420 · banner 1200×320 · social 1200×630
fieldsip,flag,location,isp,asn,score,type,native,ai,risk,time—Comma-separated list of what to show. Each size has sensible defaults.
charclaude · gpt · gemini · deepseek · … · nonenoneAI-chan character id, or none. The anime style defaults to claude.
accent5856d6—Accent color, hex without #. Each style has its own.
radius0–4824Corner radius in pixels.
mask0 · 1 · 200 shows everything, 1 hides part of the IP and the city, 2 hides the IP and location.
langzh-Hans · zh-Hant · en · jaAccept-LanguageLanguage of the labels.
title≤ 40—Custom title, up to 40 characters.
anim0 · 111 keeps the subtle CSS animations inside the SVG, 0 turns them off.

Returns image/svg+xml. Character art is embedded, so cards work in <img> tags with no external requests.

Try it

Send a live request

Run any GET request under /api/v1/ right from this page. It's your browser talking to the API, so it counts against your own rate limit.

Press Return to run. Edit the path to try other endpoints.

Ready
The response will appear here.