Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
test:
name: ${{ matrix.os }} / .NET ${{ matrix.dotnet }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
dotnet: ['8.0', '9.0', '10.0']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73
with:
dotnet-version: ${{ matrix.dotnet }}.x
- run: dotnet restore IPGeolocation.sln -p:TestTargetFramework=net${{ matrix.dotnet }} -p:NuGetAudit=true -p:NuGetAuditMode=all '-warnaserror:NU1900,NU1901,NU1902,NU1903,NU1904'
- run: dotnet test IPGeolocation.sln --no-restore -c Release -p:TestTargetFramework=net${{ matrix.dotnet }}
- run: dotnet pack src/IPGeolocation/IPGeolocation.csproj --no-build -c Release -o artifacts
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.0.1

- Hide API keys in error messages and details.
- Handle incomplete or invalid error responses.
- Fix request handling for very short or very long timeouts.
- Add Arabic (`ar`) for single and bulk lookups.

Existing public methods and .NET Standard 2.1 support remain unchanged.

## 3.0.0 - 2026-04-08

- Replaced the old generated multi-API SDK with the new .NET SDK for the IPGeolocation.io IP Location API.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Install-Package IPGeoLocation.IPGeolocation
```

```xml
<PackageReference Include="IPGeoLocation.IPGeolocation" Version="3.0.0" />
<PackageReference Include="IPGeoLocation.IPGeolocation" Version="3.0.1" />
```

- NuGet package: `IPGeoLocation.IPGeolocation`
Expand Down Expand Up @@ -144,10 +144,10 @@ Paid plans still need `include` for optional modules. `fields` and `excludes` on
| `apiKey` | `string?` | unset | Required for bulk lookup. Optional for single lookup if `requestOrigin` is set. |
| `requestOrigin` | `string?` | unset | Must be an absolute `http` or `https` origin. |
| `baseUrl` | `string` | `https://api.ipgeolocation.io` | Override the API base URL. |
| `connectTimeout` | `TimeSpan` | `10` seconds | Time to open the connection. |
| `readTimeout` | `TimeSpan` | `30` seconds | Time to wait while reading the response body. |
| `connectTimeout` | `TimeSpan` | `10` seconds | Time to connect and receive response headers. |
| `readTimeout` | `TimeSpan` | `30` seconds | Time to wait for the next part of the response. |

The client constructor accepts an `IpGeolocationClientConfig`. Timeouts are validated before the request is sent.
The client constructor accepts an `IpGeolocationClientConfig`. Both timeouts must be greater than zero.

## Available Methods

Expand All @@ -168,7 +168,7 @@ The client constructor accepts an `IpGeolocationClientConfig`. Timeouts are vali
|-------|------------|-------|
| `ip` | Single lookup | IPv4, IPv6, or domain. Omit it for caller IP lookup. |
| `ips` | Bulk lookup | Collection of 1 to 50,000 IPs or domains. |
| `lang` | Single and bulk | One of `en`, `de`, `ru`, `ja`, `fr`, `cn`, `es`, `cs`, `it`, `ko`, `fa`, `pt`. |
| `lang` | Single and bulk | One of `en`, `de`, `ru`, `ja`, `fr`, `cn`, `es`, `cs`, `it`, `ko`, `fa`, `pt`, `ar`. |
| `include` | Single and bulk | Collection of module names such as `security`, `abuse`, `user_agent`, `hostname`, `liveHostname`, `hostnameFallbackLive`, `geo_accuracy`, `dma_code`, or `*`. |
| `fields` | Single and bulk | Collection of field paths to keep, for example `location.country_name` or `security.threat_score`. |
| `excludes` | Single and bulk | Collection of field paths to remove from the response. |
Expand Down Expand Up @@ -327,7 +327,7 @@ Console.WriteLine(response.Metadata.FirstHeaderValue("content-type"));

## Errors

The SDK throws typed exceptions instead of returning error objects for failed HTTP responses.
The SDK throws typed exceptions instead of returning error objects for failed HTTP responses. SDK error messages replace your configured API key with `[REDACTED]`. SDK error types and HTTP status codes stay the same. Some technical error details may be shortened to keep the key hidden.

| Exception | When it happens |
|-----------|-----------------|
Expand Down
3 changes: 2 additions & 1 deletion src/IPGeolocation.Test/IPGeolocation.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<PropertyGroup>
<AssemblyName>IPGeolocation.Test</AssemblyName>
<RootNamespace>IPGeolocation.Test</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<TestTargetFramework Condition="'$(TestTargetFramework)' == ''">net8.0</TestTargetFramework>
<TargetFramework>$(TestTargetFramework)</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
Expand Down
Loading
Loading