Skip to content

somespecialone/sert

Repository files navigation

Steam Exchange Rate Tracker

Stay updated on Steam market prices and convert currencies with easy!

Made in Ukraine license steam code style: prettier API Test Converter codecov CodeFactor

Important

Web converter converter.somespecial.one 🧮

API sert.somespecial.one

Python API consumer aiosteampy.converter

Scheduled migration!

Warning

Converter has been moved to converter.somespecial.one. Address of the API will have the same origin but all endpoints will be moved from /api/ to / (root) path AFTER application is migrated (v3 release). Legacy routes will be available for backwards support for some time. X-Expired-At header will be replaced with Expires for native browser caching.

How it works

Every hour on 9 and 39 minute app checks if rates data in db is expired (updated yesterday or even older) and if true, update currency rates:

  1. Get data of specified item on steammarket for each needed currency.
  2. Calculate exchange rates by comparing item price in previously fetched currencies.
  3. Save data to db 😎.

Warning

It is possible to get max 4 currencies for each schedule wake up due to Steam rate limit.

API

All routes under /api path.

All currency rates eval to 1 USD 💵.

All routes have Expires ⌛ header for caching purposes.

Rates

GET /api/rates

{
  "EUR": [
    0.91, // rate
    1683121141 // updated ts in seconds
  ],
  "UAH": [
    36.71,
    1683121141
  ]
}

History

GET /api/history

{
  "EUR": [
    [
      0.91,
      1683121141
    ],
    [
      0.91,
      1682986141
    ],
    // ...
  ],
  "UAH": [
    [
      36.71,
      1683121141
    ],
    [
      36.94,
      1682986141
    ],
    // ...
  ]
}
Param Descr Default
length Max length of history entries array 30
all Show full list of entries false

Examples:

Warning

Deta micro have response size limit, so with all data can exceed this which leads to error.

Tests 🧪

Copy repo, install deps, place filled .env in api dir and there run npm script:

npm run api:test