Skip to main content

No-boilerplate, async and typed YouTube Analytics API access.

Project description

sly logo Sly YTAAPI for Python

🚧 This library is an early work in progress! Breaking changes may be frequent.

🐍 For Python 3.10+

No boilerplate, async and typed Youtube Analytics API access. 😋

pip install slyytaapi

This library does not have full coverage. Currently, the following topics are supported:

  • Targeted queries for channels and videos

You can directly grant user tokens using the command line, covering the whole OAuth 2 grant process.


Example usage:

import asyncio
from SlyYTAAPI import *

async def main():

    analytics = await YouTubeAnalytics('UCxATMl-Cv8BEF0FtZMRvRgA', 'test/app.json', 'test/user.json')

    result = await analytics.query(
        since=date(2020, 1, 1),
        metrics=Metrics.SubsGained+Metrics.SubsLost+Metrics.WatchTime,
        dims=Dimensions.Day
        )

    result.saveCSV('test/test.csv')

asyncio.run(main())

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

SlyYTAAPI-0.1.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

SlyYTAAPI-0.1.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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