https://torntargets.net/api/v1
All API requests require authentication using your API key. You can provide it in two ways:
curl -H "X-API-Key: tt_your_api_key_here" https://torntargets.net/api/v1/targets
curl https://torntargets.net/api/v1/targets?api_key=tt_your_api_key_here
API requests are limited to 100 requests per minute per API key.
Exceeding this limit will result in a 429 Too Many Requests response.
Get a list of targets with optional filters.
| Parameter | Type | Description | Default |
|---|---|---|---|
| level_min | integer | Minimum level | 1 |
| level_max | integer | Maximum level | 100 |
| status | string | Filter by status (okay, hospital, jail, traveling) | all |
| limit | integer | Number of results (max 100) | 50 |
| offset | integer | Pagination offset | 0 |
curl -H "X-API-Key: tt_your_key" \
"https://torntargets.net/api/v1/targets?level_min=50&level_max=70&status=okay"
{
"success": true,
"data": [
{
"torn_id": 1234567,
"name": "PlayerName",
"level": 65,
"faction_id": 9999,
"faction_name": "FactionName",
"status": "okay",
"last_action": "2025-09-02 12:00:00",
"battle_stats_total": 5000000,
"last_updated": "2025-09-02 14:00:00"
}
],
"timestamp": 1693584000
}
Get information about a specific target.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Torn ID of the target |
curl -H "X-API-Key: tt_your_key" \
"https://torntargets.net/api/v1/target?id=1234567"
Search for targets by name or faction.
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query |
| type | string | No | Search type: "name" or "faction" (default: "name") |
curl -H "X-API-Key: tt_your_key" \
"https://torntargets.net/api/v1/search?q=john&type=name"
Get overall statistics about the target database.
curl -H "X-API-Key: tt_your_key" \
"https://torntargets.net/api/v1/stats"
{
"success": true,
"data": {
"total_targets": 738,
"total_factions": 230,
"status_breakdown": {
"okay": 500,
"hospital": 150,
"jail": 50,
"traveling": 38
}
},
"timestamp": 1693584000
}
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
const API_KEY = 'tt_your_api_key_here';
const BASE_URL = 'https://torntargets.net/api/v1';
async function getTargets(levelMin = 50, levelMax = 70) {
const response = await fetch(
`${BASE_URL}/targets?level_min=${levelMin}&level_max=${levelMax}`,
{
headers: {
'X-API-Key': API_KEY
}
}
);
const data = await response.json();
return data;
}
// Usage
getTargets(50, 70).then(data => {
console.log(data);
});
import requests
API_KEY = 'tt_your_api_key_here'
BASE_URL = 'https://torntargets.net/api/v1'
def get_targets(level_min=50, level_max=70):
headers = {'X-API-Key': API_KEY}
params = {
'level_min': level_min,
'level_max': level_max
}
response = requests.get(f'{BASE_URL}/targets',
headers=headers,
params=params)
return response.json()
# Usage
targets = get_targets(50, 70)
print(targets)
<?php
$apiKey = 'tt_your_api_key_here';
$baseUrl = 'https://torntargets.net/api/v1';
function getTargets($levelMin = 50, $levelMax = 70) {
global $apiKey, $baseUrl;
$url = "$baseUrl/targets?" . http_build_query([
'level_min' => $levelMin,
'level_max' => $levelMax
]);
$options = [
'http' => [
'header' => "X-API-Key: $apiKey\r\n"
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
return json_decode($response, true);
}
// Usage
$targets = getTargets(50, 70);
print_r($targets);
?>
Want to use Torn Targets data in TornPDA? We have a ready-to-use script!
Get TornPDA Script