MCPcopy Create free account
hub / github.com/Rushifakami/csfloat_api / get_all_listings

Method get_all_listings

csfloat_client.py:216–303  ·  view source on GitHub ↗

:param min_price: Only include listings have a price higher than this (in cents) :param max_price: Only include listings have a price lower than this (in cents) :param cursor: Cursor to get the next page (issued by the server) :param limit: How many listings to retur

(
            self,
            *,
            min_price: Optional[int] = None,
            max_price: Optional[int] = None,
            cursor: Optional[str] = None,
            limit: int = 50,
            sort_by: str = 'best_deal',
            category: int = 0,
            def_index: Optional[Union[int, Iterable[int]]] = None,
            min_float: Optional[float] = None,
            max_float: Optional[float] = None,
            rarity: Optional[str] = None,
            paint_seed: Optional[int] = None,
            paint_index: Optional[int] = None,
            user_id: Optional[str] = None,
            collection: Optional[str] = None,
            market_hash_name: Optional[str] = None,
            type_: str = 'buy_now',
            raw_response: bool = False
    )

Source from the content-addressed store, hash-verified

214 return response
215
216 async def get_all_listings(
217 self,
218 *,
219 min_price: Optional[int] = None,
220 max_price: Optional[int] = None,
221 cursor: Optional[str] = None,
222 limit: int = 50,
223 sort_by: str = 'best_deal',
224 category: int = 0,
225 def_index: Optional[Union[int, Iterable[int]]] = None,
226 min_float: Optional[float] = None,
227 max_float: Optional[float] = None,
228 rarity: Optional[str] = None,
229 paint_seed: Optional[int] = None,
230 paint_index: Optional[int] = None,
231 user_id: Optional[str] = None,
232 collection: Optional[str] = None,
233 market_hash_name: Optional[str] = None,
234 type_: str = 'buy_now',
235 raw_response: bool = False
236 ) -> Union[Dict[str, Union[List[Listing], Optional[str]]], dict]:
237 """
238 :param min_price: Only include listings have a price higher than this (in cents)
239 :param max_price: Only include listings have a price lower than this (in cents)
240 :param cursor: Cursor to get the next page (issued by the server)
241 :param limit: How many listings to return. Max of 50
242 :param sort_by: How to order the listings
243 :param category: Can be one of: 0 = any, 1 = normal, 2 = stattrak, 3 = souvenir
244 :param def_index: Only include listings that have one of the given def index(es)
245 :param min_float: Only include listings that have a float higher than this
246 :param max_float: Only include listings that have a float lower than this
247 :param rarity: Only include listings that have this rarity
248 :param paint_seed: Only include listings that have this paint seed
249 :param paint_index: Only include listings that have this paint index
250 :param user_id: Only include listings from this SteamID64
251 :param collection: Only include listings from this collection
252 :param market_hash_name: Only include listings that have this market hash name
253 :param type_: Either buy_now or auction
254 :param raw_response: Returns the raw response from the API
255 :return: If raw_response is True, returns the full response as a dict.
256 Otherwise, returns a dict with the following structure:
257 {
258 "listings": List[Listing], # list of parsed listing objects
259 "cursor": Optional[str] # cursor string for pagination
260 }
261 """
262 self._validate_category(category)
263 self._validate_sort_by(sort_by)
264 self._validate_type(type_)
265
266 parameters = (
267 f'/listings?limit={limit}&sort_by={sort_by}'
268 f'&category={category}&type={type_}'
269 )
270 if cursor is not None:
271 parameters += f'&cursor={cursor}'
272 if min_price is not None:
273 parameters += f'&min_price={min_price}'

Callers

nothing calls this directly

Calls 5

_validate_categoryMethod · 0.95
_validate_sort_byMethod · 0.95
_validate_typeMethod · 0.95
_requestMethod · 0.95
ListingClass · 0.85

Tested by

no test coverage detected