---
title: IP Currency API - Convert Any Amount to Local Currency from an IP Address
version: 1.0.0
description: Convert an amount from one currency to the local currency of a given IP address using the latest exchange rates. Uses IP geolocation to determine the target currency based on the visitor country. Accepts source currency, IP address, and amount. Supports fiat, crypto, and metals. All parameters are case-insensitive for both fiat/currency codes and crypto/symbols.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 2
---

## Table of Contents

- [IP Currency API - Convert Any Amount to Local Currency from an IP Address v1.0.0](#ip-currency-api-convert-any-amount-to-local-currency-from-an-ip-address-v100)
  - [Authentication](#authentication)
  - [Currency APIs](#currency-apis)
    - [convertByIp](#convertbyip)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [GeolocalizedCurrencyConverterResponse](#geolocalizedcurrencyconverterresponse)
    - [ErrorResponse](#errorresponse)



# IP Currency API - Convert Any Amount to Local Currency from an IP Address v1.0.0

Convert an amount from one currency to the local currency of a given IP address using the latest exchange rates. Uses IP geolocation to determine the target currency based on the visitor country. Accepts source currency, IP address, and amount. Supports fiat, crypto, and metals. All parameters are case-insensitive for both fiat/currency codes and crypto/symbols.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## Currency APIs

### convertByIp

`GET /currency/converter/ip-to-currency`

*Convert currency based on IP geolocation*

Converts an amount to the local currency of a given IP address.

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Response format: `json` (default) or `xml`.|
|from|query|string|true|Source currency code.|
|ip|query|string|false|IPv4 or IPv6 address. Defaults to the request IP.|
|amount|query|number(float)|false|Amount to convert, as a decimal. Defaults to `1`. Non-numeric values return a 400.|
|updates|query|string|false|Update frequency: `1m` (default), `10m`, `1h`, or `1d`.|

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|
|updates|1m|
|updates|10m|
|updates|1h|
|updates|1d|

> Example responses

> Successful operation

```json
{
  "date": "2026-07-27 12:10:00+00",
  "from": "USD",
  "to": "PKR",
  "rate": "277.863",
  "ipAddress": "182.186.18.91",
  "givenAmount": "100.0",
  "convertedAmount": "27786.300"
}
```

> Bad request - Invalid IP, amount, or updates

```json
{
  "error": "Invalid Param Exception",
  "message": "please pass correct parameters",
  "path": "/v1.0/currency/converter/ip-to-currency",
  "status": 400,
  "timestamp": "2026-07-27T12:10:31.824Z"
}
```

```json
{
  "timestamp": 1785154232373,
  "status": 400,
  "error": "Method Argument Type Mismatch",
  "message": "Invalid Amount. Please provide amount in decimal format and greater than 0!",
  "path": "/v2.0/iptocurrency"
}
```

```json
{
  "timestamp": 1785154232944,
  "status": 400,
  "error": "Invalid Param Exception",
  "message": "Provided IP Address not-an-ip is invalid.",
  "path": "/v2.0/iptocurrency"
}
```

```json
{
  "timestamp": 1785154262483,
  "status": 400,
  "error": "Invalid Param Exception",
  "message": "Please provide valid updates parameter (1d,1h,10m,1m)",
  "path": "/v2.0/iptocurrency"
}
```

> Not found - IP geolocation or currency not available

```json
{
  "timestamp": 1785154233555,
  "status": 404,
  "error": "Not Found Exception",
  "message": "Geolocation of provided IP 0.0.0.0 is unknown.",
  "path": "/v2.0/iptocurrency"
}
```

```json
{
  "timestamp": 1785154234101,
  "status": 404,
  "error": "Not Found Exception",
  "message": "Rates of provided currency ZZZ are not available in our database!",
  "path": "/v2.0/iptocurrency"
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[GeolocalizedCurrencyConverterResponse](#geolocalizedcurrencyconverterresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request - Invalid IP, amount, or updates|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not found - IP geolocation or currency not available|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### GeolocalizedCurrencyConverterResponse

Geolocalized currency conversion response containing the rate and converted amount based on IP geolocation.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|date|string|true|none|Date and time with timezone (UTC) when the rate was recorded.|
|from|string|true|none|Source currency code.|
|to|string|true|none|Target currency code — the local currency of the IP.|
|rate|string|true|none|Exchange rate from source to target currency.|
|ipAddress|string|true|none|IP address used for geolocation.|
|givenAmount|string|true|none|Amount provided for conversion.|
|convertedAmount|string|true|none|Converted amount in the target (local) currency.|

### ErrorResponse

Standard error envelope returned by the API on failed requests. Gateway-level validation errors use an ISO 8601 timestamp and the public endpoint path; currency-service errors use a Unix millisecond timestamp and an internal service path instead.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|timestamp|string | integer|false|none|Timestamp when the error occurred — ISO 8601 string for gateway errors, Unix milliseconds integer for currency-service errors.|
|status|integer|false|none|HTTP status code returned with the error.|
|error|string|false|none|Specific error type (e.g., Invalid Param Exception, Method Argument Type Mismatch, Not Found Exception).|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path (gateway errors) or internal service path (currency-service errors) that produced the error.|
