API - Integration
Get Conversion
This http method allows you to retrieve a single conversion by its unique identifier.
GET
/
conversions
/
get
Ip2Geo - Get Conversion
curl --request GET \
--url https://api.ip2geo.dev/conversions/get \
--header 'x-api-key: <api-key>'import requests
url = "https://api.ip2geo.dev/conversions/get"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.ip2geo.dev/conversions/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ip2geo.dev/conversions/get")
.header("x-api-key", "<api-key>")
.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::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": {
"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
}{
"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
The unique identifier of the conversion to retrieve.
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields.
Was this page helpful?
Previous
Get ConversionsThis http method allows you to retrieve multiple conversions by their unique identifiers.
Next
⌘I
Ip2Geo - Get Conversion
curl --request GET \
--url https://api.ip2geo.dev/conversions/get \
--header 'x-api-key: <api-key>'import requests
url = "https://api.ip2geo.dev/conversions/get"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.ip2geo.dev/conversions/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ip2geo.dev/conversions/get")
.header("x-api-key", "<api-key>")
.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::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": {
"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
}{
"success": false,
"message": "<string>",
"code": 123,
"_req": {
"reqId": "<string>",
"resTime": 123
},
"data": null
}