API - Integration
Get Conversions
This http method allows you to retrieve multiple conversions by their unique identifiers.
POST
/
conversions
/
get
Ip2Geo - Get Conversions
curl --request POST \
--url https://api.ip2geo.dev/conversions/get \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"conversionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.ip2geo.dev/conversions/get"
payload = { "conversionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({conversionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.ip2geo.dev/conversions/get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ip2geo.dev/conversions/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversionIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ip2geo.dev/conversions/get"
payload := strings.NewReader("{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ip2geo.dev/conversions/get")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ip2geo.dev/conversions/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": {
"conversions": [
{
"id": 123,
"uniqueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"ip": "<string>",
"is_eu": true,
"continent": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123,
"country": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123,
"phone_code": "<string>",
"capital": "<string>",
"tld": "<string>",
"subdivision": {
"name": "<string>",
"code": "<string>"
},
"city": {
"name": "<string>",
"geoname_id": 123,
"latitude": 123,
"longitude": 123,
"accuracy_radius": 123,
"metro_code": 123,
"postal_code": "<string>",
"timezone": {
"name": "<string>",
"time_now": "<string>"
}
},
"flag": {
"img": "<string>",
"emoji": "<string>",
"emoji_unicode": "<string>"
},
"currency": {
"name": "<string>",
"code": "<string>",
"symbol": "<string>"
}
}
},
"registered_country": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123
},
"asn": {
"number": 123,
"name": "<string>"
},
"completion_time": {
"miliseconds": 123,
"seconds": 123
}
},
"status": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}Authorizations
Use your Ip2Geo secret key (i2g_sk_...) for server-side requests, or public key (i2g_pk_...) for client-side requests. Example: x-api-key: i2g_sk_abc123.
Query Parameters
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields.
Body
application/json
Array of conversion IDs to retrieve.
Maximum array length:
100Was this page helpful?
Previous
List ConversionsThis http method allows you to list your conversions with pagination, filtering, and field selection.
Next
⌘I
Ip2Geo - Get Conversions
curl --request POST \
--url https://api.ip2geo.dev/conversions/get \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"conversionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.ip2geo.dev/conversions/get"
payload = { "conversionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({conversionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.ip2geo.dev/conversions/get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ip2geo.dev/conversions/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversionIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ip2geo.dev/conversions/get"
payload := strings.NewReader("{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ip2geo.dev/conversions/get")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ip2geo.dev/conversions/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversionIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": {
"conversions": [
{
"id": 123,
"uniqueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"ip": "<string>",
"is_eu": true,
"continent": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123,
"country": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123,
"phone_code": "<string>",
"capital": "<string>",
"tld": "<string>",
"subdivision": {
"name": "<string>",
"code": "<string>"
},
"city": {
"name": "<string>",
"geoname_id": 123,
"latitude": 123,
"longitude": 123,
"accuracy_radius": 123,
"metro_code": 123,
"postal_code": "<string>",
"timezone": {
"name": "<string>",
"time_now": "<string>"
}
},
"flag": {
"img": "<string>",
"emoji": "<string>",
"emoji_unicode": "<string>"
},
"currency": {
"name": "<string>",
"code": "<string>",
"symbol": "<string>"
}
}
},
"registered_country": {
"name": "<string>",
"code": "<string>",
"geoname_id": 123
},
"asn": {
"number": 123,
"name": "<string>"
},
"completion_time": {
"miliseconds": 123,
"seconds": 123
}
},
"status": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}