Skip to main content

MRKT Python Client

An asynchronous Python client for the MRKT API.

Features

  • Authenticated API access with MrktClient
  • Multi-account requests with MrktPool
  • Gifts, orders, offers, and user API methods
  • Access-token and Telegram-session authentication
  • Optional proxy support

Requirements

  • Python 3.10 or newer
  • aiohttp
  • kurigram for Telegram-session authentication

Install dependencies:

pip install aiohttp kurigram

Quick Start

import asyncio

from mrkt.client import MrktClient


async def get_orders(client: MrktClient, collection: str) -> None:
    async with client as api:
        orders = await api.orders.list(
            collectionNames=[collection],
            count=10,
        )
        print(orders)


client = MrktClient(token="YOUR_ACCESS_TOKEN")
asyncio.run(get_orders(client, "Plush Pepe"))

The HTTP session is created lazily when the client enters the async context, so the client can safely be created before asyncio.run().

You can also create it inside the coroutine:

async def main() -> None:
    async with MrktClient(token="YOUR_ACCESS_TOKEN") as api:
        print(await api.gifts.collections())


asyncio.run(main())

Always close clients with async with or await client.close().

Authentication

Access token

client = MrktClient(token="YOUR_ACCESS_TOKEN")

Telegram session

import asyncio

from mrkt.client import MrktClient


async def main() -> None:
    client = await MrktClient.session(
        "my_telegram_session",
        workdir=".",
    )
    async with client as api:
        print(await api.user.me())


asyncio.run(main())

A proxy can be passed with proxy="http://host:port".

API Examples

Gifts

async with MrktClient(token="YOUR_ACCESS_TOKEN") as api:
    listings = await api.gifts.saling(
        collectionNames=["Plush Pepe"],
        count=20,
        ordering="Price",
        lowToHigh=True,
    )
    inventory = await api.gifts.inventory(isListed=False)

Available methods include collections, models, backdrops, saling, inventory, history, feed, buy, and sale.

Orders

async with MrktClient(token="YOUR_ACCESS_TOKEN") as api:
    orders = await api.orders.list(
        collectionNames=["Plush Pepe"],
        count=10,
    )
    top_orders = await api.orders.top(collectionName="Plush Pepe")

Available methods include create, cancel, list, fill, getMyOrders, allCollectionTop, giftsHistory, and top.

Offers

async with MrktClient(token="YOUR_ACCESS_TOKEN") as api:
    activities = await api.offers.activities(count=20)
    offers = await api.offers.myOffersByGift("GIFT_ID")

Available methods include create, cancel, activities, and myOffersByGift.

User

async with MrktClient(token="YOUR_ACCESS_TOKEN") as api:
    profile = await api.user.me()
    balance = await api.user.balance()
    transactions = await api.user.transactions()

Multiple Accounts

import asyncio

from mrkt.pool import MrktPool


async def get_balance(client) -> dict:
    async with client as api:
        return await api.user.balance()


async def main() -> None:
    async with MrktPool(tokens=["TOKEN_1", "TOKEN_2"]) as pool:
        results = await pool.map(get_balance, concurrency=2)
        for result in results:
            print(result)


asyncio.run(main())

MrktPool.map() returns exceptions as results. Check them before using the response:

for result in results:
    if isinstance(result, Exception):
        print(f"Request failed: {result}")

Create a pool from Telegram sessions:

pool = await MrktPool.from_sessions(
    ["account_1", "account_2"],
    workdir=".",
    concurrency=2,
)

Configuration

MrktClient supports these main options:

  • token: an existing TGMRKT access token
  • session: a Telegram session name
  • workdir: directory containing session files
  • proxy: optional HTTP or SOCKS proxy
  • headers: additional HTTP headers
  • packed: attach gifts, orders, and offers API objects

Development

Run a syntax check from the repository root:

python -m py_compile *.py

License

Released under the MIT License. See LICENSE.

Metadata

Release files for tgmrkts 0.1.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 tgmrkts 0.1.0
File Size Uploaded
tgmrkts-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tgmrkts 0.1.0
File Interpreter ABI Platform
tgmrkts-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / tgmrkts-0.1.0.tar.gz

Download URL tgmrkts-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
476e9113ec8cedd4d37e207fe524aed690d44f7d17ed114cdfe09250eb9c8c0e
BLAKE2b-256 checksum
How to use checksums
f6cb53232b2c6989ef5bb5b649982a81dc964f7411c813808d4501eb9a3c09f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / tgmrkts-0.1.0-py3-none-any.whl

Download URL tgmrkts-0.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e8d6674b9b17dab58ae22a8b332d06570e94ffd8794be75313eac8effb81aef
BLAKE2b-256 checksum
How to use checksums
386cd8db53d8a0c82d182fde89c98afc9d332ce5a05c75b3d213cacfa1341cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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