Introduction
Our SDKs provide a type-safe way to use our conversion services directly through installable packages. In essence, they’re lightweight wrappers around our REST API, but with type safety, auto-completion, and an enhanced developer experience (DX).
Available SDKs
We offer official SDKs for the following languages:
| Language | Package |
|---|---|
| TypeScript/JavaScript | @ip2geo/sdk |
| Ruby | ip2geo |
| Python | ip2geo-sdk |
| PHP | ip2geo-dev/sdk |
Working from a terminal instead? The ip2geo CLI makes the same calls, and everything the dashboard does, from the command line.
Why Use the SDK Instead of the REST API?
-
Type Safety: Get full TypeScript/Ruby/Python support to catch issues early and reduce runtime errors.
-
Simplified Integration: Includes pre-built functions for requests, authentication, and response handling, no need to manually set up HTTP calls.
-
Faster Development: Focus on your app’s logic while the SDK handles the boilerplate.
-
Better Docs: Clear examples and typings make it easy to discover and use available methods.
-
Automatic Updates: The SDKs stay in sync with the API, giving you access to the latest endpoints and improvements.
Installation
The TypeScript SDK works with all major JavaScript runtimes that support npm, including Node.js, Deno, Bun, and the browser (with public keys).
npm install @ip2geo/sdk@latestbun add @ip2geo/sdk@latestdeno install @ip2geo/sdk@latestyarn add @ip2geo/sdk@latestpnpm add @ip2geo/sdk@latestThe Ruby SDK works with Ruby 2.7 and above. Install via Bundler or directly with gem.
Add to your Gemfile:
gem 'ip2geo'Then run:
bundle installgem install ip2geoThe Python SDK works with Python 3.8 and above. Install via pip.
pip install ip2geo-sdkAdd to your requirements.txt:
ip2geo-sdkThen run:
pip install -r requirements.txtThe PHP SDK works with PHP 8.0 and above. Install via Composer.
composer require ip2geo-dev/sdk