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
- ifauthData
is not providedgiftsError
:if
max_price
is less thanmin_price
ormin_price
andmax_price
are not integersif
gift_name
,model
,backdrop
orsymbol
are not strings or listsif
sort
is not one of the valid optionsif
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 setoffset
to2*limit
. Default is0
.limit
(int) - limit of gifts to show. Default is20
, maximum (for now) is100
. Default is20
.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 formodel
(str | list, optional) - model name / list of model names to search forbackdrop
(str | list, optional) - backdrop name / list of backdrop names to search forsymbol
(str | list, optional) - symbol name / list of symbols to search formin_price
(int, optional) - min price of the searching giftsmax_price
(int, optional) - max price of the searching giftsauthData
(str) - authentication data required for the api request
Activity object
Methods:
.toDict()
: Converts theActivity
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