← Back to docs

irclog-api-reference

Language: EN | EN | SV

IRC Log API Reference

Base URL: https://tools.tornevall.net/api/irclog

Rate Limit: 60 requests per minute


Authentication

Most endpoints are public and require no authentication.

For authenticated endpoints (highlights, collections, comments), use Sanctum API tokens:

Authorization: Bearer YOUR_API_TOKEN

Get your API token from /keys/mine when logged in.


Endpoints

🔍 Search Logs

Search through IRC logs with various filters.

Endpoint: GET /api/irclog/search

Query Parameters:

Parameter Type Required Description Example
q string No Text search (message, nick, alias) sweden
network_id integer No Filter by network 1
channel_id integer No Filter by channel 2
event_type string No Filter by event type PRIVMSG
nick string No Filter by nickname TT_
date_from date No Start date (YYYY-MM-DD) 1999-01-01
date_to date No End date (YYYY-MM-DD) 1999-12-31
limit integer No Results limit (1-500) 50

Event Types:

Example Request:

GET /api/irclog/search?q=sweden&network_id=1&limit=20

Example Response:

{
  "success": true,
  "results": [
    {
      "id": 123,
      "event_type": "PRIVMSG",
      "occurred_at": "1999-04-14 23:12:00",
      "message_text": "Hej från #sweden!",
      "raw_line": "<TT_> Hej från #sweden!",
      "nick": "TT_",
      "network_name": "IRCNet",
      "channel_name": "#sweden"
    }
  ],
  "count": 1,
  "query": {
    "q": "sweden",
    "network_id": 1,
    "limit": 20
  }
}

🌐 List Networks

Get all available IRC networks.

Endpoint: GET /api/irclog/networks

Example Request:

GET /api/irclog/networks

Example Response:

{
  "success": true,
  "networks": [
    {
      "id": 1,
      "name": "IRCNet",
      "description": "Original IRC network from 1988"
    },
    {
      "id": 2,
      "name": "EFNet",
      "description": "Eris Free Network"
    }
  ]
}

📺 List Channels

Get channels for a specific network.

Endpoint: GET /api/irclog/networks/{networkId}/channels

Example Request:

GET /api/irclog/networks/1/channels

Example Response:

{
  "success": true,
  "channels": [
    {
      "id": 1,
      "name": "#sweden",
      "network_id": 1
    },
    {
      "id": 2,
      "name": "#fwd-point",
      "network_id": 1
    }
  ]
}

🎯 Get Event

Get a specific IRC event by ID.

Endpoint: GET /api/irclog/events/{id}

Example Request:

GET /api/irclog/events/123

Example Response:

{
  "success": true,
  "event": {
    "id": 123,
    "event_type": "PRIVMSG",
    "occurred_at": "1999-04-14 23:12:00",
    "message_text": "Hej från #sweden!",
    "raw_line": "<TT_> Hej från #sweden!",
    "nick": "TT_",
    "network_name": "IRCNet",
    "channel_name": "#sweden",
    "channel_id": 1,
    "alias_id": null,
    "identity_id": 5
  }
}

🔐 Authenticated Endpoints

The following endpoints require authentication via Sanctum API token.

📌 Highlights

List Highlights:

GET /api/irclog/highlights
Authorization: Bearer YOUR_TOKEN

Create Highlight:

POST /api/irclog/highlights
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "event_id": 123,
  "title": "Epic moment",
  "description": "This was funny"
}

Update Highlight:

PUT /api/irclog/highlights/{id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "title": "Updated title"
}

Delete Highlight:

DELETE /api/irclog/highlights/{id}
Authorization: Bearer YOUR_TOKEN

📚 Collections

List Collections:

GET /api/irclog/collections
Authorization: Bearer YOUR_TOKEN

Create Collection:

POST /api/irclog/collections
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "title": "Best of 1999",
  "description": "Memorable moments",
  "is_public": true
}

Update Collection:

PUT /api/irclog/collections/{id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "title": "Updated title"
}

Delete Collection:

DELETE /api/irclog/collections/{id}
Authorization: Bearer YOUR_TOKEN

💬 Comments

Create Comment:

POST /api/irclog/comments
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "event_id": 123,
  "comment_text": "This was hilarious!"
}

Delete Comment:

DELETE /api/irclog/comments/{id}
Authorization: Bearer YOUR_TOKEN

🎨 mIRC Colors

IRC logs may contain mIRC color codes. The API preserves these codes in message_text.

Color Codes:

Color Palette (0-15):

0=White, 1=Black, 2=Blue, 3=Green, 4=Red, 5=Brown,
6=Purple, 7=Orange, 8=Yellow, 9=Light Green, 10=Cyan,
11=Light Cyan, 12=Light Blue, 13=Pink, 14=Grey, 15=Light Grey

Use ColorRenderer service to convert to HTML or strip colors.


📊 Response Format

Success Response

{
  "success": true,
  "results": [...],
  "count": 10
}

Error Response

{
  "success": false,
  "error": "Event not found",
  "message": "The requested resource could not be found"
}

HTTP Status Codes:


📖 Examples

Search for specific text in a network

curl -X GET "https://tools.tornevall.net/api/irclog/search?q=awesome&network_id=1" \
  -H "Accept: application/json"

Get all channels on IRCNet

curl -X GET "https://tools.tornevall.net/api/irclog/networks/1/channels" \
  -H "Accept: application/json"

Search by nickname

curl -X GET "https://tools.tornevall.net/api/irclog/search?nick=TT_&limit=100" \
  -H "Accept: application/json"

Date range search

curl -X GET "https://tools.tornevall.net/api/irclog/search?date_from=1999-01-01&date_to=1999-12-31" \
  -H "Accept: application/json"

Create highlight (authenticated)

curl -X POST "https://tools.tornevall.net/api/irclog/highlights" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"event_id": 123, "title": "Epic moment"}'

🚀 Rate Limiting

Limit: 60 requests per minute per IP address

Headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1645678901

When rate limit exceeded:

{
  "message": "Too Many Attempts.",
  "exception": "Illuminate\\Http\\Exceptions\\ThrottleRequestsException"
}

🔒 CORS

CORS is enabled for all origins on public endpoints.

Authenticated endpoints require proper CORS configuration.


📝 Pagination

Currently, pagination is handled via limit parameter (max 500).

Full pagination with cursor/offset coming soon.


🐛 Support

Issues: Report via admin panel
Documentation: /docs/irclog-api-reference
Viewer: https://tools.tornevall.net/irc


Last Updated: 2026-02-25
Version: 1.0