IP geolocation API code examples
Choose a language or runtime to call the caller IP and explicit IP endpoints with secret-safe authentication, request timeouts, HTTP error checks, and JSON response parsing.
Last updated August 10, 2026
cURL
Authenticated IP lookup using cURL command line, including timeout and error handling.
View example →JavaScript
Authenticated IP lookup using JavaScript fetch, including timeout and error handling.
View example →TypeScript
Authenticated IP lookup using typed TypeScript fetch, including timeout and error handling.
View example →Node.js
Authenticated IP lookup using Node.js built-in fetch, including timeout and error handling.
View example →Python
Authenticated IP lookup using Python requests, including timeout and error handling.
View example →PHP
Authenticated IP lookup using PHP cURL, including timeout and error handling.
View example →Laravel
Authenticated IP lookup using Laravel HTTP client, including timeout and error handling.
View example →Go
Authenticated IP lookup using Go net/http, including timeout and error handling.
View example →Java
Authenticated IP lookup using Java HttpClient, including timeout and error handling.
View example →C# and .NET
Authenticated IP lookup using .NET HttpClient, including timeout and error handling.
View example →Ruby
Authenticated IP lookup using Ruby Net::HTTP, including timeout and error handling.
View example →Rust
Authenticated IP lookup using Rust reqwest, including timeout and error handling.
View example →Swift
Authenticated IP lookup using Swift URLSession, including timeout and error handling.
View example →Kotlin
Authenticated IP lookup using Kotlin Java HTTP client, including timeout and error handling.
View example →