nixonjoshua98 / dexscreener

Python API wrapper for dexscreener.com
https://docs.dexscreener.com/api/reference
MIT License
104 stars 22 forks source link

How to get data from response? Says the object is not subscriptable #3

Closed 6abd closed 11 months ago

6abd commented 11 months ago

I want to get specific data about the pair, so I make calls such as:

pair = client.get_token_pair(chain, address) # API call for dexscreener.com data
dexID = pair["dexID"]

But I get the error:

TypeError: 'TokenPair' object is not subscriptable

How can I make correct calls?

6abd commented 11 months ago

I'm so dumb, I forgot to convert to json