sorare / api

Sorare API documentation
154 stars 49 forks source link

Get player min price #151

Open AlessandroCordella opened 2 years ago

AlessandroCordella commented 2 years ago

What is the straightforward way to get the minimum current price of a player in the market (no auctions)?

I tried to get all the cursor for a card_slug and then get all the offer for each cursor, but it seems a inefficient approach:

get_all_cursor:

query_cursor = """
        query findCursor($slug: String!) {
      player(slug: $slug) {
        cards(rarities: [limited]) {
            edges{
            cursor
          }
        }
      }
    }
        """
    variables = {
        "slug": card_slug
    }

get_offer_from_cursor:

query = """
    query findPlayer($slug: String!, $after: String) {
  player(slug: $slug) {
    cards(rarities: [limited], after: $after) {
      nodes {
        slug
        onSale
        liveSingleSaleOffer {
          price
          priceInFiat {
            eur
          }
        }
      }
        edges{
        cursor
      }
      pageInfo {
        startCursor
        endCursor
        hasNextPage
        hasPreviousPage
      }
    }
  }
}
    """
    variables = {
        "slug": card_slug,
        "after": cursor
    }

Is there a way to directly retrieve the current minimum price from a card_slug, exluding the auctions?

Samsuma86 commented 2 years ago

@AlessandroCordella

Did you get a feedback ? I´am also still trying

AlessandroCordella commented 2 years ago

@AlessandroCordella

Did you get a feedback ? I´am also still trying

No :(

nachoroncero commented 2 years ago

Hello, did you get to solve this?

AlessandroCordella commented 2 years ago

Hello, I haven't tried to implement anything yet, but there are some additional details here: https://github.com/sorare/api/issues/236