The API is available at:
https://api.ltesocks.io/v2All public operations require an API token. Create one in Dashboard → Settings → Profile → API Token, then keep it in a secret manager or environment variable.
export LTESOCKS_API_TOKEN="replace-with-your-token"curl --request GET \ --url "https://api.ltesocks.io/v2/user" \ --header "Accept: application/json" \ --header "Accept-Language: en" \ --header "Authorization: Bearer ${LTESOCKS_API_TOKEN}"JavaScript
Section titled “JavaScript”const response = await fetch('https://api.ltesocks.io/v2/user', { headers: { Accept: 'application/json', 'Accept-Language': 'en', Authorization: `Bearer ${process.env.LTESOCKS_API_TOKEN}`, },});
if (!response.ok) { const problem = await response.json(); throw new Error(problem.error ?? `HTTP ${response.status}`);}
const user = await response.json();console.log(user.login);Python
Section titled “Python”import osimport requests
response = requests.get( "https://api.ltesocks.io/v2/user", headers={ "Accept": "application/json", "Accept-Language": "en", "Authorization": f"Bearer {os.environ['LTESOCKS_API_TOKEN']}", }, timeout=30,)response.raise_for_status()print(response.json()["login"])<?php
$token = getenv('LTESOCKS_API_TOKEN');$request = curl_init('https://api.ltesocks.io/v2/user');
curl_setopt_array($request, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Accept-Language: en', "Authorization: Bearer {$token}", ], CURLOPT_TIMEOUT => 30,]);
$body = curl_exec($request);$status = curl_getinfo($request, CURLINFO_RESPONSE_CODE);curl_close($request);
if ($status < 200 || $status >= 300) { throw new RuntimeException("LTESocks API returned HTTP {$status}: {$body}");}
$user = json_decode($body, true, flags: JSON_THROW_ON_ERROR);echo $user['login'];Official SDKs
Section titled “Official SDKs”Install one of the official SDKs to keep authentication, typed models, errors, idempotency, pagination, and downloads in one maintained client. The SDK equivalent of the requests above is:
import { LTESocksClient } from '@ltesocks/sdk';
const client = LTESocksClient.withBearerToken( process.env.LTESOCKS_API_TOKEN, { language: 'en' },);const user = await client.user.get();
console.log(user.login);import os
from ltesocks_sdk import Client
with Client.with_bearer_token( os.environ["LTESOCKS_API_TOKEN"], language="en",) as client: user = client.user.get() print(user.login)<?php
use LTESocks\Client;
require __DIR__ . '/vendor/autoload.php';
$client = Client::builder() ->withBearerToken((string) getenv('LTESOCKS_API_TOKEN')) ->withLanguage('en') ->build();$user = $client->user()->get();
echo $user->getLogin();Next steps
Section titled “Next steps”- Read authentication before storing the token in production.
- Choose and install an official SDK.
- Learn the request and response conventions.
- Discover plans, servers, and signatures.
- Follow the mobile port lifecycle.