IPstack API is a comprehensive IP geolocation service that provides detailed location information for IPv4 and IPv6 addresses, including country, city, coordinates, timezone, currency, and ISP data. The API offers three main endpoints: Standard IP Lookup for single addresses, Bulk IP Lookup for multiple addresses, and Requester IP Lookup to detect the requesting IP address, with support for multiple languages and output formats
$ dotnet add package IpstackSDKTo get started quickly, you need to fork the IP Stack Postman Collection. Simply click the button below to fork it.
IP Stack Postman collection contains all the three endpoint supported by IP Stack API.
We recommend you to start with the Standard IP Lookup endpoint as it's primary endpoint. It is used to look up single IPv4 or IPv6 addresses. To call this endpoint, simply attach any IPv4 or IPv6 address to the API's base URL.
Check out all the widely used API calls with the necessary parameters in the Standard IP Lookup folder.
If you are building with .NET CLI tools then you can also use the following command:
dotnet add package IpstackSDK --version 1.0.0
You can also view the package at: https://www.nuget.org/packages/IpstackSDK/1.0.0
The generated SDK also contain one or more Tests, which are contained in the Tests project. In order to invoke these test cases, you will need NUnit 3.0 Test Adapter Extension for Visual Studio. Once the SDK is complied, the test cases should appear in the Test Explorer window. Here, you can click Run All to execute these test cases.
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| Environment | Environment | The API environment. Default: Environment.Production |
| Timeout | TimeSpan | Http client timeout. Default: TimeSpan.FromSeconds(100) |
| HttpClientConfiguration | Action<HttpClientConfiguration.Builder> | Action delegate that configures the HTTP client by using the HttpClientConfiguration.Builder for customizing API call settings. Default: new HttpClient() |
| CustomQueryAuthenticationCredentials | CustomQueryAuthenticationCredentials | The Credentials Setter for Custom Query Parameter |
The API client can be initialized as follows:
using IPstack.Standard;
using IPstack.Standard.Authentication;
IPstackClient client = new IPstackClient.Builder()
.CustomQueryAuthenticationCredentials(
new CustomQueryAuthenticationModel.Builder(
"access_key"
)
.Build())
.Environment(IPstack.Standard.Environment.Production)
.Build();
This API uses the following authentication schemes.