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 14, 2026
Languages & Runtimes
Use standard or widely adopted HTTP clients from command-line tools and application runtimes.
cURL
Authenticated IP lookup using cURL command line, including usage, testing, timeout, and error handling.
View tutorial →JavaScript
Authenticated IP lookup using JavaScript fetch, including usage, testing, timeout, and error handling.
View tutorial →TypeScript
Authenticated IP lookup using typed TypeScript fetch, including usage, testing, timeout, and error handling.
View tutorial →Node.js
Authenticated IP lookup using Node.js built-in fetch, including usage, testing, timeout, and error handling.
View tutorial →Python
Authenticated IP lookup using Python requests, including usage, testing, timeout, and error handling.
View tutorial →PHP
Authenticated IP lookup using PHP cURL, including usage, testing, timeout, and error handling.
View tutorial →Go
Authenticated IP lookup using Go net/http, including usage, testing, timeout, and error handling.
View tutorial →Java
Authenticated IP lookup using Java HttpClient, including usage, testing, timeout, and error handling.
View tutorial →C# and .NET
Authenticated IP lookup using .NET HttpClient, including usage, testing, timeout, and error handling.
View tutorial →Ruby
Authenticated IP lookup using Ruby Net::HTTP, including usage, testing, timeout, and error handling.
View tutorial →Rust
Authenticated IP lookup using Rust reqwest, including usage, testing, timeout, and error handling.
View tutorial →Swift
Authenticated IP lookup using Swift URLSession, including usage, testing, timeout, and error handling.
View tutorial →Kotlin
Authenticated IP lookup using Kotlin Java HTTP client, including usage, testing, timeout, and error handling.
View tutorial →Deno
Authenticated IP lookup using Deno fetch, including usage, testing, timeout, and error handling.
View tutorial →Frameworks & Server Integrations
Keep IPRout credentials server-side inside common web frameworks and maintained client libraries.
Axios
Authenticated IP lookup using Axios for server-side JavaScript, including usage, testing, timeout, and error handling.
View tutorial →Next.js
Authenticated IP lookup using Next.js server route, including usage, testing, timeout, and error handling.
View tutorial →Express
Authenticated IP lookup using Express server route, including usage, testing, timeout, and error handling.
View tutorial →Laravel
Authenticated IP lookup using Laravel HTTP client, including usage, testing, timeout, and error handling.
View tutorial →Django
Authenticated IP lookup using Django server view, including usage, testing, timeout, and error handling.
View tutorial →FastAPI
Authenticated IP lookup using FastAPI async route, including usage, testing, timeout, and error handling.
View tutorial →Symfony
Authenticated IP lookup using Symfony HttpClient, including usage, testing, timeout, and error handling.
View tutorial →Spring Boot
Authenticated IP lookup using Spring RestClient, including usage, testing, timeout, and error handling.
View tutorial →ASP.NET Core
Authenticated IP lookup using ASP.NET Core minimal API, including usage, testing, timeout, and error handling.
View tutorial →Ruby on Rails
Authenticated IP lookup using Rails controller, including usage, testing, timeout, and error handling.
View tutorial →