marketActivity

marketActivity()

async def marketActivity(sort: str, offset: int, limit: int, activityType: str | list, gift_name: str | list, model: str | list, backdrop: str | list, symbol: str | list, min_price: int, max_price: int, authData: str) -> list[Activity]

Retrieve list of activities on the market

Returns

list of Activity objects

Raises

  • authDataError - if authData is not provided

  • giftsError:

    • if max_price is less than min_price or min_price and max_price are not integers

    • if gift_name, model, backdrop or symbol are not strings or lists

    • if sort is not one of the valid options

    • if activityType is not one of the valid options

  • requestError - if request fails

Parameters

  • sort (str) - The sorting method for the results. Options are: "latest", "price_asc", "price_desc", "gift_id_asc", "gift_id_desc", "model_rarity_asc", "model_rarity_desc". Defaults to "price_asc".

  • offset (int) - pagination offset. For example, to get 2nd page you need to set offset to 2*limit . Default is 0.

  • limit (int) - limit of gifts to show. Default is 20, maximum (for now) is 100. Default is 20.

  • activityType (str | list, optional) - activity type(s) to show. Options are: "", "buy", "listing", "price_update", "offer" . Also can be list of these options. Example: activityType = ["listing", "price_update"]

  • gift_name (str | list, optional) - gift name / list of gift names to search for

  • model (str | list, optional) - model name / list of model names to search for

  • backdrop (str | list, optional) - backdrop name / list of backdrop names to search for

  • symbol (str | list, optional) - symbol name / list of symbols to search for

  • min_price (int, optional) - min price of the searching gifts

  • max_price (int, optional) - max price of the searching gifts

  • authData (str) - authentication data required for the api request

Activity object

Methods:

  • .toDict(): Converts the Activity object back to a dictionary format.

Attributes:

  • .nft: Returns a PortalsGift object. See PortalsGift

  • .offer_id: If activity type is offer, it will return it's id. If not, will return None.

  • .type: activity type

  • .amount: price of the NFT

  • .created_at: date+time of when the activity has been created

Example

from aportalsmp.gifts import marketActivity
from aportalsmp.auth import update_auth
import asyncio

auth = asyncio.run(update_auth(api_id=123, api_hash="..."))

async def main():
    activities = await marketActivity(authData=auth)
    for activity in activities:
        print(activity.nft.name, activity.nft.tg_id, activity.amount, activity.type, activity.created_at, activity.offer_id)
        # will print something like this:
        # Easter Egg 130535 8.0 listing 2025-06-29T13:49:40.031398Z None
        # Jester Hat 2293 8.0 listing 2025-06-29T13:49:40.016664Z None

See used functions: update_auth

Last updated