Full Documentation

A basic example can be found at Basic Usage

Example

>>> from urmarketscraper import market
>>> market.get_market_offers(session, ["1462", "1463"])
Returns:
    {"1462": {"_Offer__id": 1462, "_Offer__level_price_dict": {"1": "799", "4": "799"}}, "1463": {"_Offer__id": 1463,
 "_Offer__level_price_dict": {"2": "27887"}}}

Market Module

urmarketscraper.market.get_market_offers(session, ids, base_market_url='https://www.urban-rivals.com/market/?')

Main function for interaction with this library.

Provided a sequence of Character Ids, returns a dictionary of offers for each. Requires a session which has already authenticated with Urban Rivals.

Optional: provide a base market URL for proxy. Must end with a “?” Ex: “http://example.com?”

>>>get_market_offers(session, [1400, 1423, 1764])

{1400: Offer, 1423: Offer, 1764: Offer}

>>>get_market_offers(session, [“1301”, “1543”])

{“1301”: Offer, “1543”: Offer}

Offer Object

class urmarketscraper.offer.Offer(id=0, level_price_dict=None)
get_min_level()

Return level for lowest price in dict

get_min_price()

Return lowest price in dict

get_rel_level(target_level)

Return target level, or min level if not available

get_rel_price(target_level)

Return price of target level, or min price if not available

property id

The character id this offer refers to.

Getter

Returns this Offer’s id

Setter

Sets this Offer’s id

Type

int (conversion is applied)

property level_price_dict

The dictionary of level-to-price relationships for this offer.

Getter

Returns this Offer’s level-price-dict

Setter

Sets this Offer’s level-price-dict

Type

dict (sets to None if not type conformant)

urmarketscraper Documentation TOC

Indices and tables