Skip to main content
First, install valaw. See the Installation guide for directions. After installing, import valaw into your project:
import valaw
import asyncio
Then initialize the client with your API token and the cluster closest to you:
client = valaw.Client("YOUR_API_TOKEN", "americas")
A production key is strongly recommended — development keys only have access to a handful of endpoints and will return 403 errors for most of the API. You can apply for a production key through the Riot Developer Portal.
All API methods are async and must be called inside an async function. Always call client.close() when you are done to cleanly shut down the session.
After initializing the client, you can use it to make requests. For example, to get content for the na region:
async def main():
    content = await client.GET_getContent("na", "en-US")
    print(content)
    await client.close()

asyncio.run(main())
A full working example:
import valaw
import asyncio

async def main():
    client = valaw.Client("YOUR_API_TOKEN", "americas")
    try:
        content = await client.GET_getContent("na", "en-US")
        print(content)
    finally:
        await client.close()

asyncio.run(main())

Raw data

If you want raw JSON dictionaries instead of typed objects, pass raw_data=True:
client = valaw.Client("YOUR_API_TOKEN", "americas", raw_data=True)
This returns the raw API response as a dict instead of a typed object like ContentDto.