Token Data to USD

Saw another similiar thread on this but figured I would make my own. I essentially have BEP-20 Token X and I am trying to get price data for the last week for that token as it has traded on PancakeSwap back and forth.

I have my query below (the original token address is labeled as X):

query {
  ethereum(network: bsc) {
    dexTrades(any: [
      {baseCurrency: {is: "X"}, quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, 
      {baseCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}, quoteCurrency: {is: "0xe9e7cea3dedca5984780bafc599bd69add087d56"}}], 
    date: {since: "2021-05-19T18:05:00.000Z", till: "2021-05-20T18:05:00.000Z"}, 
     ) {
      timeInterval {
        minute(count: 60, format: "%Y-%m-%dT%H:%M:%SZ")
      }
      buyAmount: baseAmount
      buyAmountInUsd: baseAmount
      sellAmountInUsd: quoteAmount
    }
  }
}

New to this API so not even sure if this is the right query, all I really need is price data across two given dates for a BEP-20 and I’d like it to be converted to USD instead of BNB (or BUSD in this case as the USD peg). Very unsure about how base and quote currencies work in relation to this api.

Any help would be awesome. Thanks again.

Read this article PancakeSwap - Querying DEXs on Binance Smart Chain using GraphQL APIs

Also change exchange to in the queries to get pancake v2 data to

exchangeName: {in: [“Pancake”, “Pancake v2”]}

Additionally check examples on our IDE for get price of a given token

and also enter your token address on our explorer and check DEX trades related we are showing for your token