Purchase residential data from the authenticated account balance
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ltesocks.io/v2/proxies/residential");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Idempotency-Key: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0");headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.ltesocks.io/v2/proxies/residential"), Headers = { { "Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.ltesocks.io/v2/proxies/residential"
payload := strings.NewReader("{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.ltesocks.io/v2/proxies/residential")) .header("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }");Request request = new Request.Builder() .url("https://api.ltesocks.io/v2/proxies/residential") .post(body) .addHeader("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.ltesocks.io/v2/proxies/residential', headers: { 'Idempotency-Key': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, data: {tariff_id: 1, tariff_option_id: 1, price_hash: 'example'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.ltesocks.io/v2/proxies/residential';const options = { method: 'POST', headers: { 'Idempotency-Key': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"tariff_id":1,"tariff_option_id":1,"price_hash":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"tariff_id\": 1, \"tariff_option_id\": 1, \"price_hash\": \"example\" }")val request = Request.Builder() .url("https://api.ltesocks.io/v2/proxies/residential") .post(body) .addHeader("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.ltesocks.io/v2/proxies/residential";
let payload = json!({ "tariff_id": 1, "tariff_option_id": 1, "price_hash": "example" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0".parse().unwrap()); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://api.ltesocks.io/v2/proxies/residential \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --data '{ "tariff_id": 1, "tariff_option_id": 1, "price_hash": "example" }'wget --quiet \ --method POST \ --header 'Idempotency-Key: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "tariff_id": 1, "tariff_option_id": 1, "price_hash": "example" }' \ --output-document \ - https://api.ltesocks.io/v2/proxies/residentialRequires proxy.residential.create and a UUID Idempotency-Key. Client identity is derived from authentication. Reuse the same key and body for an uncertain result. Responses for successful purchases and uncertain server errors are retained for 24 hours. A cached server error requires operator reconciliation before a new payment. A 409 priceChanged response requires fetching offers and explicitly confirming again.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "tariff_id": 1, "tariff_option_id": 1, "price_hash": "example"}Responses
Section titled “Responses”Data purchased.
object
Missing idempotency key.
Authentication required.
Insufficient account balance.
Missing purchase scope or inactive account.
Price changed (error_code=priceChanged with data containing a new quote), or request still in progress (Retry-After header).
Invalid request or key reused with different parameters.
Uncertain upstream outcome. Retain the key and reconcile before another purchase.