Skip to main content

Cookie API

Official wrapper for the Cookie API.

⚙️ Installation

Python 3.9 or higher is required

pip install cookie-api

🔑 How to get an API key?

  1. Invite Cookie to your Discord server or to your Discord account
  2. Run /premium api

🚀 Example Usage

The API key can be passed as a parameter or set as the environment variable COOKIE_KEY. For more information, see to our documentation.

Sync Example

from cookie import CookieAPI

api = CookieAPI(api_key="[YOUR_API_KEY]")

user_stats = api.get_user_stats(123456789)  # Replace with user ID

Async Example

import asyncio
from cookie import AsyncCookieAPI

api = AsyncCookieAPI(api_key="[YOUR_API_KEY]")

async def main():
    user_stats = await api.get_user_stats(123456789)  # Replace with user ID
    await api.close()

asyncio.run(main())

You can also use an asynchronous context manager (recommended)

async def main():
    async with api as con:
        user_stats = await con.get_user_stats(123456789)  # Replace with user ID

⚡ OpenAPI Docs

If you want to use the API without this wrapper, you can find the OpenAPI docs here.

The models in this package are automatically generated using the OpenAPI spec:

python cookie/_internal/model_generator.py

Metadata

Release files for cookie-api 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cookie-api 0.3.0
File Size Uploaded Provenance Actions
cookie_api-0.3.0.tar.gz 8.5 kB With provenance Details for cookie_api-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cookie-api 0.3.0
File Interpreter ABI Platform Actions
cookie_api-0.3.0-py3-none-any.whl Python 3 none any Details for cookie_api-0.3.0-py3-none-any.whl

Total release size: 16.9 kB

Security for cookie-api 0.3.0

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.

Select from 2 files

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page