ApifreaksApi 1.1.2

dotnet add package ApifreaksApi --version 1.1.2
                    
NuGet\Install-Package ApifreaksApi -Version 1.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApifreaksApi" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApifreaksApi" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="ApifreaksApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApifreaksApi --version 1.1.2
                    
#r "nuget: ApifreaksApi, 1.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ApifreaksApi@1.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApifreaksApi&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=ApifreaksApi&version=1.1.2
                    
Install as a Cake Tool

Apifreaks .NET SDK

fern shield NuGet shield

The Apifreaks .NET library provides convenient access to the Apifreaks APIs from C# and other .NET languages.

Table of Contents

Installation

Install the package from NuGet:

dotnet add package ApifreaksApi

Or add it directly to your .csproj:

<ItemGroup>
  <PackageReference Include="ApifreaksApi" Version="0.1.0" />
</ItemGroup>

Reference

A full reference for this library is available here.

Usage

Instantiate and use the client with the following:

using ApifreaksApi;

var client = new ApifreaksApiClient();

var request = new GeolocationLookupRequest
{
    ApiKey = "your_api_key",
    Ip = "8.8.8.8",
};

var response = await client.GeolocationLookupAsync(request);

Console.WriteLine(response);

Environments

This SDK allows you to configure the API base URL through ClientOptions.

using ApifreaksApi;

var client = new ApifreaksApiClient(
    new ClientOptions
    {
        BaseUrl = ApifreaksApiEnvironment.Default,
    }
);

Errors

When the API returns a non-success status code, the SDK throws an exception.

using ApifreaksApi;

try
{
    var response = await client.GeolocationLookupAsync(
        new GeolocationLookupRequest
        {
            ApiKey = "your_api_key",
            Ip = "8.8.8.8",
        }
    );

    Console.WriteLine(response);
}
catch (ApifreaksApiApiException e)
{
    Console.WriteLine($"API error {e.StatusCode}: {e.Body}");
}
catch (ApifreaksApiException e)
{
    Console.WriteLine($"SDK error: {e.Message}");
}

Request Types

The SDK exports request and response types in the ApifreaksApi namespace.

using ApifreaksApi;

var request = new GeolocationLookupRequest
{
    ApiKey = "your_api_key",
    Ip = "8.8.8.8",
};

Advanced

Retries

The SDK is instrumented with automatic retries with exponential backoff. By default, the client retries retryable requests up to 2 times.

Configure retries globally:

using ApifreaksApi;

var client = new ApifreaksApiClient(
    new ClientOptions
    {
        MaxRetries = 3,
    }
);

Configure retries for a single request:

var response = await client.GeolocationLookupAsync(
    new GeolocationLookupRequest
    {
        ApiKey = "your_api_key",
        Ip = "8.8.8.8",
    },
    new RequestOptions
    {
        MaxRetries = 3,
    }
);

Timeouts

The SDK defaults to a 30 second timeout. Configure timeouts globally:

var client = new ApifreaksApiClient(
    new ClientOptions
    {
        Timeout = TimeSpan.FromSeconds(30),
    }
);

Configure a timeout for a single request:

var response = await client.GeolocationLookupAsync(
    new GeolocationLookupRequest
    {
        ApiKey = "your_api_key",
        Ip = "8.8.8.8",
    },
    new RequestOptions
    {
        Timeout = TimeSpan.FromSeconds(30),
    }
);

Additional Headers

Add custom headers globally:

var client = new ApifreaksApiClient(
    new ClientOptions
    {
        AdditionalHeaders = new[]
        {
            new KeyValuePair<string, string?>("X-Custom-Header", "custom-value"),
        },
    }
);

Add custom headers for a single request:

var response = await client.GeolocationLookupAsync(
    new GeolocationLookupRequest
    {
        ApiKey = "your_api_key",
        Ip = "8.8.8.8",
    },
    new RequestOptions
    {
        AdditionalHeaders = new[]
        {
            new KeyValuePair<string, string?>("X-Custom-Header", "custom-value"),
        },
    }
);

Additional Query String Parameters

Add custom query parameters for a single request:

var response = await client.GeolocationLookupAsync(
    new GeolocationLookupRequest
    {
        ApiKey = "your_api_key",
        Ip = "8.8.8.8",
    },
    new RequestOptions
    {
        AdditionalQueryParameters = new[]
        {
            new KeyValuePair<string, string>("filter", "active"),
            new KeyValuePair<string, string>("sort", "desc"),
        },
    }
);

Raw Response Metadata

Directly awaiting a method returns the parsed response data. Use .WithRawResponse() when you need status code, headers, or URL metadata.

var rawResponse = await client.GeolocationLookupAsync(
    new GeolocationLookupRequest
    {
        ApiKey = "your_api_key",
        Ip = "8.8.8.8",
    }
).WithRawResponse();

Console.WriteLine(rawResponse.RawResponse.StatusCode);
Console.WriteLine(rawResponse.Data);

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 40 9/30/2026
1.1.1 107 9/17/2026
1.1.0 97 9/15/2026