For developers who want to search logs or integrate with other systems.
The API lets you search IRC logs directly without using the web interface. Perfect for:
Add the key to every request:
curl -H "Authorization: Bearer YOUR_KEY" \
https://tools.tornevall.net/api/irclog/search?q=hello
GET /api/irclog/search?q=hello&channel_id=123
Returns first 100 results containing "hello" in channel 123.
POST /api/irclog/search
Authorization: Bearer YOUR_KEY
Content-Type: application/json
{
"query": "php mysql",
"channel_id": 123,
"nick": "Robin",
"date_from": "2024-01-01",
"date_to": "2024-12-31",
"limit": 50,
"page": 1
}
Response:
{
"results": [
{
"id": 12345,
"channel": "#general",
"network": "EFNet",
"nick": "Robin",
"message": "php and mysql",
"occurred_at": "2024-01-15T14:30:00Z",
"permalink": "/irclog/h/abc123xyz"
}
],
"total": 42,
"page": 1,
"per_page": 50
}
GET /api/irclog/highlights
Authorization: Bearer YOUR_KEY
Response:
{
"highlights": [
{
"id": 789,
"title": "Funny quote",
"event": {
"nick": "Robin",
"message": "That was funny!",
"date": "2024-01-15T14:30:00Z"
},
"permalink": "/irclog/h/abc123xyz"
}
]
}
POST /api/irclog/highlights
Authorization: Bearer YOUR_KEY
Content-Type: application/json
{
"log_event_id": 12345,
"title": "Important quote",
"note": "This person was right",
"is_public": true
}
Response:
{
"id": 789,
"permalink": "/irclog/h/abc123xyz"
}
Now you can share the link /irclog/h/abc123xyz with others!
const API_KEY = 'your_key_here';
// Search
async function search(query) {
const response = await fetch(
'https://tools.tornevall.net/api/irclog/search?q=' + query,
{
headers: {
'Authorization': 'Bearer ' + API_KEY
}
}
);
const data = await response.json();
return data.results;
}
// Use it
search('php mysql').then(results => {
results.forEach(r => {
console.log(r.nick + ': ' + r.message);
});
});
import requests
API_KEY = 'your_key_here'
headers = {'Authorization': f'Bearer {API_KEY}'}
# Search
response = requests.post(
'https://tools.tornevall.net/api/irclog/search',
headers=headers,
json={
'query': 'php mysql',
'channel_id': 123,
'limit': 50
}
)
results = response.json()['results']
for msg in results:
print(f"{msg['nick']}: {msg['message']}")
<?php
$apiKey = 'your_key_here';
$ch = curl_init('https://tools.tornevall.net/api/irclog/search');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'query' => 'php mysql',
'channel_id' => 123,
'limit' => 50
])
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
foreach ($data['results'] as $msg) {
echo $msg['nick'] . ': ' . $msg['message'] . "\n";
}
?>
If something goes wrong:
{
"error": "Something went wrong",
"code": "ERROR_CODE"
}
Common error codes:
AUTH_REQUIRED - You forgot the API keyNOT_FOUND - Channel or data not foundRATE_LIMIT - Too many requests (max 100/minute)VALIDATION_ERROR - Invalid parameterNeed higher limits? Contact admin!
Always use ISO 8601 format for dates:
2024-01-15 ← Date only
2024-01-15T14:30:00Z ← Date + time (UTC)
docs/sv/irclog-anvandandarguide.md (Swedish)Version: 1.0
Updated: 2026-02-24