{"openapi":"3.1.0","info":{"title":"CrocPeek API","version":"1.0.0","description":"IP, ASN and domain lookups. Send your API key as `Authorization: Bearer <key>` or in `X-API-Key`. Only `GET /v1/ip` works without a key.","termsOfService":"https://crocpeek.com/terms","contact":{"email":"contact@crocpeek.com"}},"servers":[{"url":"https://crocpeek.com/v1"}],"tags":[{"name":"Lookup"},{"name":"Account"}],"paths":{"/ip":{"get":{"tags":["Lookup"],"summary":"Your own address","description":"The caller’s IP address and what Cloudflare knows about the connection. No key needed; limited per IP.","responses":{"200":{"description":"The caller’s connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"The address could not be determined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ip/{ip}":{"get":{"tags":["Lookup"],"summary":"IP address details","description":"Routing, network, ownership, RPKI status and location of an IPv4 or IPv6 address. Private and reserved addresses are rejected.","security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"name":"ip","in":"path","required":true,"schema":{"type":"string"},"example":"1.1.1.1"}],"responses":{"200":{"description":"Details of the address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IpInfo"}}},"headers":{"X-Quota-Limit":{"description":"Requests allowed this month","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Requests left this month","schema":{"type":"integer"}},"X-Quota-Reset":{"description":"When the monthly quota resets (ISO 8601, UTC)","schema":{"type":"string"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Per-minute limit or monthly quota reached (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"An upstream data source failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Over capacity for today; try again after UTC midnight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/asn/{asn}":{"get":{"tags":["Lookup"],"summary":"Autonomous system details","description":"Holder, announced ranges (up to 500 per family, largest first), neighbours ranked by power, and abuse contacts. Accepts `13335` or `AS13335`.","security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"name":"asn","in":"path","required":true,"schema":{"type":"string"},"example":"AS13335"}],"responses":{"200":{"description":"Details of the AS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsnInfo"}}},"headers":{"X-Quota-Limit":{"description":"Requests allowed this month","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Requests left this month","schema":{"type":"integer"}},"X-Quota-Reset":{"description":"When the monthly quota resets (ISO 8601, UTC)","schema":{"type":"string"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Per-minute limit or monthly quota reached (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"An upstream data source failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Over capacity for today; try again after UTC midnight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domain/{domain}":{"get":{"tags":["Lookup"],"summary":"Domain DNS records","description":"The A, AAAA and NS records of a domain name.","security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"example":"example.com"}],"responses":{"200":{"description":"DNS records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainInfo"}}},"headers":{"X-Quota-Limit":{"description":"Requests allowed this month","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Requests left this month","schema":{"type":"integer"}},"X-Quota-Reset":{"description":"When the monthly quota resets (ISO 8601, UTC)","schema":{"type":"string"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Per-minute limit or monthly quota reached (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"An upstream data source failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Over capacity for today; try again after UTC midnight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"tags":["Account"],"summary":"Your plan and usage","description":"Not counted against the quota, and still answers once the quota is used up.","security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"responses":{"200":{"description":"Plan, limits and usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Per-minute limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Create keys in the dashboard."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Error":{"type":"object","required":["ok","code","message"],"properties":{"ok":{"const":false},"code":{"type":"string","description":"Stable machine-readable code, e.g. rate_limited, invalid_key, not_found, over_capacity"},"message":{"type":"string"}}},"Connection":{"type":"object","properties":{"ok":{"const":true},"ip":{"type":"string"},"version":{"enum":[4,6]},"country":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"region":{"type":["string","null"]},"city":{"type":["string","null"]},"timezone":{"type":["string","null"]},"asn":{"type":["integer","null"]},"organization":{"type":["string","null"]}}},"IpInfo":{"type":"object","properties":{"ok":{"const":true},"ip":{"type":"string"},"version":{"enum":[4,6]},"cidr":{"type":["string","null"],"description":"The announced prefix containing the address"},"asn":{"type":["integer","null"]},"asName":{"type":["string","null"]},"organization":{"type":["string","null"]},"networkAddress":{"type":["string","null"],"description":"IPv4 only"},"subnetMask":{"type":["string","null"]},"binarySubnetMask":{"type":["string","null"]},"class":{"type":["string","null"]},"numberOfHosts":{"type":["integer","null"],"description":"Total addresses in the prefix (IPv4 only)"},"rdns":{"type":["string","null"]},"rpki":{"enum":["valid","invalid_asn","invalid_length","unknown"],"description":"RPKI validation of the prefix and origin AS; null when it could not be checked","type":[null,"null"]},"abuseContacts":{"type":"array","items":{"type":"string"},"description":"Registered abuse email addresses. Often empty or outdated."},"country":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"city":{"type":["string","null"]},"latitude":{"type":["number","null"],"description":"From a geolocation database; can be off by a lot, and null when unknown"},"longitude":{"type":["number","null"]},"routing":{"oneOf":[{"$ref":"#/components/schemas/Routing"},{"type":"null"}]},"ms":{"type":"integer","description":"How long the lookup took"}}},"Prefix":{"type":"object","properties":{"prefix":{"type":"string"},"origin":{"type":["integer","null"]}}},"Routing":{"type":"object","description":"How the announced prefix looks in BGP, from the route collectors of RIPE RIS; null when it could not be checked","properties":{"visibility":{"type":["object","null"],"properties":{"seen":{"type":"integer"},"total":{"type":"integer"}},"description":"Collector peers that see the prefix, out of all peers of that IP version"},"origins":{"type":"array","items":{"type":"integer"}},"firstSeen":{"type":["string","null"]},"lastSeen":{"type":["string","null"]},"lessSpecifics":{"type":"array","items":{"$ref":"#/components/schemas/Prefix"}},"moreSpecifics":{"type":"array","items":{"$ref":"#/components/schemas/Prefix"},"description":"At most 10"},"moreSpecificsCount":{"type":"integer"},"upstreams":{"type":"array","items":{"type":"object","properties":{"asn":{"type":"integer"},"paths":{"type":"integer"}}},"description":"Networks right before the origin on the paths seen, most common first"},"pathsSeen":{"type":"integer","description":"Distinct AS paths seen"},"shortestPath":{"type":["integer","null"]}}},"Neighbour":{"type":"object","properties":{"asn":{"type":"integer"},"power":{"type":"integer","description":"Number of route collectors that see the link"},"ipv4Peers":{"type":"integer"},"ipv6Peers":{"type":"integer"}}},"AsnInfo":{"type":"object","properties":{"ok":{"const":true},"asn":{"type":"integer"},"asName":{"type":["string","null"]},"organization":{"type":["string","null"]},"announced":{"type":"boolean"},"ipv4PrefixCount":{"type":"integer"},"ipv6PrefixCount":{"type":"integer"},"ipv4Prefixes":{"type":"array","items":{"type":"string"}},"ipv6Prefixes":{"type":"array","items":{"type":"string"}},"upstreams":{"type":"array","items":{"$ref":"#/components/schemas/Neighbour"}},"downstreams":{"type":"array","items":{"$ref":"#/components/schemas/Neighbour"}},"otherNeighbours":{"type":"array","items":{"$ref":"#/components/schemas/Neighbour"}},"abuseContacts":{"type":"array","items":{"type":"string"},"description":"Registered abuse email addresses. Often empty or outdated."},"ms":{"type":"integer"}}},"DomainInfo":{"type":"object","properties":{"ok":{"const":true},"domain":{"type":"string"},"ipv4Addresses":{"type":"array","items":{"type":"string"}},"ipv6Addresses":{"type":"array","items":{"type":"string"}},"nameServers":{"type":"array","items":{"type":"string"}},"ms":{"type":"integer"}}},"Usage":{"type":"object","properties":{"ok":{"const":true},"plan":{"enum":["free","pro"]},"perMinute":{"type":"integer"},"perMonth":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"},"resetsAt":{"type":"string","format":"date-time"}}}}}}