Skip to content

RetroAchievements/api-python

Repository files navigation

RetroAchievements Logo

retroachievements-api

A Python library that lets you get achievement, user, and game data from RetroAchievements.

Documentation: Get Started


Status

This library is currently a work in progress, endpoint and test coverage can be found below:

ℹ️  Endpoint coverage: 8 of 30
ℹ️  Test coverage: 0 of 30

Features

✅  Officially-supported, aligns 1:1 with the RAWeb API.
✅  Backwards-compatible, easy migration path to API v2.
✅  Supports Python 3.11+.


Documentation

Learn how to authenticate and start pulling data from RetroAchievements on our documentation website.

Installation

Coming Soon

How to begin making API calls

To use any endpoint function in the API, you must first be authorized by RetroAchievements. Fortunately, this is a fairly straightforward process.

  1. Visit your control panel on the RA website.

  2. Find the "Keys" section on the page. Copy the web API key value. Do not expose your API key anywhere publicly.

  3. You can now create your authorization object using your web API key.

from retroachievements import RAClient

userName = '<your username on RA>'
webApiKey = '<your web API key>'

auth = RAClient(userName, webApiKey)
  1. You now have all you need to use any function in the API. Each function takes this authorization object as its first argument. Here's an example:
from retroachievements import getGame

// This returns basic metadata about the game on this page:
// https://retroachievements.org/game/14402
game = auth.getGame(14402);

Contributing

See Contribution Guidelines and Code of Conduct.

Security Vulnerabilities

Please review our security policy.

Credits

License

MIT License (MIT). See License File.