Skip to content
/ api Public

API powering some Chatterino features

License

Notifications You must be signed in to change notification settings

Chatterino/api

Folders and files

NameName
Last commit message
Last commit date
Mar 1, 2025
Apr 8, 2023
Aug 1, 2021
Dec 11, 2022
Apr 4, 2023
Mar 4, 2025
Dec 28, 2024
Dec 25, 2021
Oct 26, 2021
Mar 4, 2025
Feb 22, 2025
Dec 23, 2017
Jul 30, 2022
Apr 8, 2023
Nov 17, 2024
Dec 28, 2024
Dec 11, 2022
Mar 6, 2025
Mar 6, 2025
Jul 30, 2022
Dec 18, 2021

Repository files navigation

Build status codecov

API

Go web service that serves as a cache to APIs that each Chatterino client could use.

Routes

Resolve URL

link_resolver/:url
Resolves a url into a preview tooltip.
Route content type: application/json
Route HTTP Status Code is almost always 200 as long as we were able to generate information about the URL, even if the API we call returns 404 or 500.
If the given URL is not a valid url, the Route HTTP status code will be 400.

Examples

url parameter: https://example.com/page

{
  "status": 200,                                               // status code returned or inferred from the page
  "thumbnail": "http://api.url/thumbnail/web.com%2Fimage.png", // proxied thumbnail url if there's an image
  "message": "",                                               // used to forward errors in case the website e.g. couldn't load
  "tooltip": "<div>tooltip</div>",                             // HTML tooltip used in Chatterino
  "link": "http://example.com/longer-page"                     // final url, after any redirects
}

url parameter: https://example.com/error

{
  "status": 404,
  "message": "Page not found"
}

API Uptime

health/uptime
Returns API service's uptime. Example response:

928h2m53.795354922s

API Memory usage

health/memory
Returns information about memory usage. Example response:

Alloc=505 MiB, TotalAlloc=17418866 MiB, Sys=3070 MiB, NumGC=111245

API Uptime and memory usage

health/combined
Returns both uptime and information about memory usage. Example response:

Uptime: 928h5m7.937821282s - Memory: Alloc=510 MiB, TotalAlloc=17419213 MiB, Sys=3070 MiB, NumGC=111246

Using your self-hosted version

If you host your own version of this API, you can modify which url Chatterino2 uses to resolve links and to resolve twitch emote sets.
Change link resolver
Change Twitch emote resolver
How to build and host
Running in Docker