Skip to main content

a wrapper around osrs api's

Project description

The project

The goal is to make a wrapper around the varius runescape related api's.

Runelite

prices

Runelite prices api: https://prices.runescape.wiki/api/v1/osrs/ you must provide some identification to tell who you are, preferably with a discord tag or email

from osrs import runelite

api = runelite.RunelitePrices(identification='extreme4all#6455')

to get a mapping of item names, id, low & high alch values etc

print(api.items())

to get latest prices averaging over an interval or from a specific timestamp

intervals = [
    '5m',
    '10m',
    '30m',
    '1h',
    '6h',
    '24h'
]
print(api.prices(interval='24h'))
print(api.prices(interval='24h', timestamp=1628380800))

to get a timeseries of the 300 values averaged over interval by item id or item name

print(api.timeseries(interval='5m', id=2))
print(api.timeseries(interval='5m', name='Cannonball'))

to get the latest prices of items

print(api.latest())

OSRS

The osrs endpoints, these endpoints are heavily rate limited

osrsPrices

from osrs import osrs

api = osrs.OsrsPrices(identification='extreme4all#6456')

OSRS has only one category, with all the items, here you get each alpha or letter and howmany items are in it

print(api.category())

The items endpoint is paginated and will return 12 items for each page

print(api.items(letter='a', page=0))

You can get the itemDetails for a specific item, based on item_id

print(api.itemDetail(item_id=4151))

You can get the item price as a timeseries based on item_id

print(api.timeseries(item_id=4151))

hiscores

return the hiscore for a player

from osrs import osrs

api = osrs.Hiscores(identification='extreme4all#6456')
modes = [
    'hiscore_oldschool', 'hiscore_oldschool_ironman', 'hiscore_oldschool_hardcore_ironman',
    'hiscore_oldschool_ultimate','hiscore_oldschool_deadman','hiscore_oldschool_seasonal',
    'hiscore_oldschool_tournament'
]
    
print(api.player(player_name='extreme4all', mode='hiscore_oldschool'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osrs-0.0.8.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

osrs-0.0.8-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file osrs-0.0.8.tar.gz.

File metadata

  • Download URL: osrs-0.0.8.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for osrs-0.0.8.tar.gz
Algorithm Hash digest
SHA256 799afe7e752d3987f338084fe5cbcec80848ea6aabd29463d2e44c6cf01aa9e2
MD5 f114c174387c1e0950b27696c178f302
BLAKE2b-256 8d40fab05c397ed7907f6bf4a91d129499472178dc49aabaae86b4b885729258

See more details on using hashes here.

File details

Details for the file osrs-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: osrs-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for osrs-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5239f9c4a38b1be5ec383a62fd763ce2447c354e5157013cdc6c16321d08af
MD5 6e3644d41ba89927b5aea67692060eb2
BLAKE2b-256 e3b88b7daf83c13529da9a70b7fe070249a6a22db33e071609e57bf0f6e12855

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page