GeoPulse provides two ways to use the service:
To use either option, you'll need to follow these initial steps:
Your API key is required to authenticate your requests and access our services. Keep it secure and do not share it publicly.
This documentation will guide you through the setup, API key usage, and implementation of usage options.
The offline implementation is highly recommended as it eliminates the need to rely on third-party cloud services and it's usually cheaper for medium to big applications. All operations are conducted locally, optimizing both bandwidth usage and response times.
How does it work? It's straightforward: GeoPulse provides a lightweight HTTP server that runs locally on your machine. The server downloads and manages the geolocation database automatically.
GeoPulse provides pre-built binaries for all major operating systems. Follow these steps to get started:
Available binaries:
GeoPulse-linux-arm
- Linux ARMGeoPulse-linux-x86
- Linux x86GeoPulse-macos-arm
- macOS ARM (Apple Silicon)GeoPulse-macos-x86
- macOS x86 (Intel)GeoPulse-windows.exe
- WindowsYou can find the list of actual binaries at
https://github.com/GeoPulseData/pulse/tree/main/binaries
Using curl (example for Linux ARM):
curl -L https://github.com/GeoPulseData/pulse/raw/main/binaries/GeoPulse-linux-arm -o geopulse
Replace GeoPulse-linux-arm
with your target binary from the list above.
chmod +x ./geopulse
You can configure the server using command-line arguments or a configuration file:
./geopulse --port 3456 --key YOUR_API_KEY
--port
- The port number for the server (default: 3456)--key
- Your GeoPulse API keyAlternatively, you can create a .geopulse
file relative to geopulse with your API key. Then you can run the server without the --key
argument:
./geopulse --port 3456
GeoPulse will automatically pick the API KEY from the .geopulse
file
Once the server is running, you can use it exactly like the Cloud API. The only difference is the base URL:
http://localhost:3456/ip/{ip}
http://localhost:3456/ip/{ip}?baseCurrency=EUR
In case you want to use this with an environment that uses Typescript, here are the types returned by GeoPule.pro
export interface Country {
name: string
code: string
capital: string
callingCode: string
isEUMember: boolean
currency?: {
code: string;
name: string;
symbol: string;
};
flag: {
svg: string;
emoji: string
}
continent: {
name: string;
code: string;
}
language: {
name: string;
code: string
}
}
export interface IPGeoPulse {
ip: string,
latitude?: string,
longitude?: string,
isMobile?: string,
city?: string,
state?: string,
zip?: string,
country: Country,
exchangeRateBaseCurrency?: string,
exchangeRate?: number,
timeZone?: {
name: string,
localTime: string,
localTimeUnix: string,
},
}
If your application server is running on the same machine as the GeoPulse server, you can simply use:
http://localhost:3456
If your application and GeoPulse servers are on different networks, you'll need to:
http://your-geopulse-server:3456
Fun fact: The GeoPulse Cloud API actually uses the same HTTP server internally, ensuring consistent behavior between offline and cloud deployments.