{"openapi":"3.1.0","info":{"title":"IP Location API","description":"This API provides the geographical location of an IP address. It returns the country, city, and IP address information for both the client's IP or a specific IPv4 or IPv6 address.","version":"0.1.0"},"paths":{"/api/address/":{"get":{"summary":"Get Requester Address","description":"Returns the requester's IP address and whether it is IPv4 or IPv6,\nwithout a GeoIP lookup. The home page calls it on the ipv4. and ipv6.\nsubdomains to find the client's address on the other protocol.","operationId":"get_requester_address_api_address__get","responses":{"200":{"description":"Address retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientAddressResponse"},"example":{"ip":"2001:db8::1","version":6}}}}}}},"/api/ip/":{"get":{"summary":"Get Requester Ip","description":"Fetches the geographical location details of the client making the request.\nReturns the country, city, and organisation along with the client's IP address.\nIf GeoIP database or IP lookup fails, a 404 or 500 error will be raised.","operationId":"get_requester_ip_api_ip__get","responses":{"200":{"description":"Location details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientLocationResponse"},"example":{"country":"Ukraine","iso_code":"UA","city":"Kropyvnytskyi","ip":"192.168.1.1","version":4,"org":"Example ASN Organisation"}}}},"400":{"description":"The given string is not a valid IP address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"404":{"description":"IP address not found in the GeoIP database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"500":{"description":"An internal server error occurred while processing the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}}}},"/api/ip/{ip}/":{"get":{"summary":"Get Ip Location","description":"Fetches geographical and ASN details for a specific IP address.\nIf IP is not found in the GeoIP database, a 404 error is raised.\nIf an internal error occurs, a 500 error is raised.","operationId":"get_ip_location_api_ip__ip___get","parameters":[{"name":"ip","in":"path","required":true,"schema":{"type":"string","title":"Ip"}}],"responses":{"200":{"description":"Location details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientLocationResponse"},"example":{"country":"Ukraine","iso_code":"UA","city":"Kropyvnytskyi","ip":"192.168.1.1","version":4,"org":"Example ASN Organisation"}}}},"400":{"description":"The given string is not a valid IP address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"404":{"description":"IP address not found in the GeoIP database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"500":{"description":"Internal server error occurred while processing the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dns/{test_id}/":{"get":{"summary":"Get Dns Resolvers","description":"Returns the DNS resolvers that looked up <test_id>-<n>.dns.<domain> in the\nlast minute, with their location details. The home page runs the lookups\nand then calls this.\n\nEach resolver's `same_network` says whether it belongs to the same network\n(ASN organisation) as the requester's IP address, and `leak` is true if any\nresolver doesn't. Behind a VPN, that means DNS queries bypass the tunnel,\nunless the resolver is a DNS provider you chose. Either is null when it\ncan't be told, e.g. when an address isn't in the GeoIP database.","operationId":"get_dns_resolvers_api_dns__test_id___get","parameters":[{"name":"test_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$","title":"Test Id"}}],"responses":{"200":{"description":"Resolvers retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsLeakResponse"},"example":{"leak":false,"resolvers":[{"country":"Ukraine","iso_code":"UA","city":"Kropyvnytskyi","ip":"192.0.2.53","version":4,"org":"Example ASN Organisation","same_network":true}]}}}},"404":{"description":"The DNS leak test isn't enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"500":{"description":"An internal server error occurred while processing the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ClientAddressResponse":{"properties":{"ip":{"type":"string","title":"Ip"},"version":{"type":"integer","title":"Version"}},"type":"object","required":["ip","version"],"title":"ClientAddressResponse"},"ClientLocationResponse":{"properties":{"country":{"type":"string","title":"Country"},"iso_code":{"type":"string","title":"Iso Code"},"city":{"type":"string","title":"City"},"ip":{"type":"string","title":"Ip"},"version":{"type":"integer","title":"Version"},"org":{"type":"string","title":"Org"}},"type":"object","required":["country","iso_code","city","ip","version","org"],"title":"ClientLocationResponse"},"DnsLeakResponse":{"properties":{"leak":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Leak"},"resolvers":{"items":{"$ref":"#/components/schemas/DnsResolverResponse"},"type":"array","title":"Resolvers"}},"type":"object","required":["leak","resolvers"],"title":"DnsLeakResponse"},"DnsResolverResponse":{"properties":{"country":{"type":"string","title":"Country"},"iso_code":{"type":"string","title":"Iso Code"},"city":{"type":"string","title":"City"},"ip":{"type":"string","title":"Ip"},"version":{"type":"integer","title":"Version"},"org":{"type":"string","title":"Org"},"same_network":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Same Network"}},"type":"object","required":["country","iso_code","city","ip","version","org","same_network"],"title":"DnsResolverResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Message":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"Message"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}