The project
The goal is to make a wrapper around the various oldschool runescape api's.
osrs hiscores
import asyncio
from aiohttp import ClientSession
from osrs.asyncio import Hiscore, HSMode
from osrs.utils import RateLimiter
from osrs.exceptions import PlayerDoesNotExist
async def main():
# 100 calls per minute
limiter = RateLimiter(calls_per_interval=100, interval=60)
hiscore_instance = Hiscore(proxy="", rate_limiter=limiter)
async with ClientSession() as session:
player_stats = await hiscore_instance.get(
mode=HSMode.OLDSCHOOL,
player="extreme4all",
session=session,
)
print(player_stats)
# if you do not provide a session we'll make one for you, this session will not be reused
# for multiple requests we advice doing that within one session like the example above
player_stats = await hiscore_instance.get(
mode=HSMode.OLDSCHOOL,
player="extreme4all",
)
print(player_stats)
# Run the asynchronous main function
if __name__ == "__main__":
asyncio.run(main())
osrs itemdb (Catalogue & Grand Exchange)
import asyncio
from aiohttp import ClientSession
from osrs.asyncio import ItemDBMode, Catalogue, Graph
from osrs.utils import RateLimiter
async def main():
# Initialize the Catalogue with optional proxy and rate limiter
limiter = RateLimiter(calls_per_interval=100, interval=60)
catalogue_instance = Catalogue(proxy="", rate_limiter=limiter)
graph_instance = Graph(proxy="", rate_limiter=limiter)
async with ClientSession() as session:
# Example 1: Fetching items by alphabetical filter
alpha = "A" # Items starting with "A"
page = 1 # First page of results
category = 1 # Category identifier, for OSRS there is only 1 category
items = await catalogue_instance.get_items(
session,
alpha=alpha,
page=page,
mode=ItemDBMode.OLDSCHOOL,
category=category
)
print("Fetched Items:", items)
# Example 2: Fetching detailed information for a specific item
item_id = 4151 # Example item ID (Abyssal whip in OSRS)
item_detail = await catalogue_instance.get_detail(
session,
item_id=item_id,
mode=ItemDBMode.OLDSCHOOL
)
print("Item Detail:", item_detail)
# Example 3: Fetching historical trade data (price graph) for a specific item
item_id = 4151 # Example item ID (Abyssal whip in OSRS)
trade_history = await graph_instance.get_graph(
session,
item_id=item_id,
mode=ItemDBMode.OLDSCHOOL
)
print("Trade History:", trade_history)
# Run the asynchronous main function
if __name__ == "__main__":
asyncio.run(main())
wiki prices
the wiki via runelite collects item price, which they expose via an api.
import asyncio
from aiohttp import ClientSession
from osrs.asyncio import WikiPrices, Interval
from osrs.utils import RateLimiter
async def main():
limiter = RateLimiter(calls_per_interval=100, interval=60)
prices_instance = WikiPrices(user_agent="Your User Agent", rate_limiter=limiter)
async with ClientSession() as session:
# Fetch item mappings
mappings = await prices_instance.get_mapping(
session=session
)
print("Item Mappings:", mappings)
# Fetch latest prices
latest_prices = await prices_instance.get_latest_prices(
session=session
)
print("Latest Prices:", latest_prices)
# Fetch average prices
average_prices = await prices_instance.get_average_prices(
session=session,
interval=Interval.FIVE_MIN
)
print("Average Prices:", average_prices)
# Fetch time series data
item_id = 4151 # Example item ID (Abyssal whip in OSRS)
time_series = await prices_instance.get_time_series(
session=session,
item_id=item_id,
timestep=Interval.ONE_HOUR
)
print("Time Series Data:", time_series)
# Run the asynchronous main function
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for osrs 0.0.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| osrs-0.0.16.tar.gz | 11.1 kB | With provenance | Details for osrs-0.0.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| osrs-0.0.16-py3-none-any.whl | Python 3 | none | any | Details for osrs-0.0.16-py3-none-any.whl |
Total release size: 22.4 kB
Release files / osrs-0.0.16.tar.gz
| Download URL | osrs-0.0.16.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
320387302d9426869d4d077cc87e40f698fb403a94d4070312e512f5042e9ac4
|
|
BLAKE2b-256 checksum How to use checksums |
97d2cc58ed80ab7accac3a86f773477256c70c24559d4488bb9a58a8238071bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2025.
Transparency logRelease files / osrs-0.0.16-py3-none-any.whl
| Download URL | osrs-0.0.16-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a799e243dbe423ab5dbef3a9aed25a7f9748091807767212a1ad944abe4e020
|
|
BLAKE2b-256 checksum How to use checksums |
895df4b2cedbe5c9813750efa478e0de7e2a9e2a102dc23a6330da1ed2187ef4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2025.
Transparency logSecurity for osrs 0.0.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for osrs-0.0.16.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.