Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cookie-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-api

An API wrapper for the Cookie API

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
1

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

⚡ FastAPI Docs

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc