How to correctly call the API endpoint with Python 3 without getting error 500?

445 views Asked by At

I am following the instruction as per the API documentation and enquiring the following endpoint:

summary = 'https://api.pancakeswap.info/api/v2/summary'

However I am getting the following error:

{'error': {'code': 500, 'message': 'GraphQL error: panic processing query: only derived fields can lead to multiple children here'}}

Here is my code:

import requests
import json

summary = 'https://api.pancakeswap.info/api/v2/summary'

def get_data(endpoint):
    data = requests.get(endpoint).json()
    print(data)


get_data(summary)

What am I doing wrong and how to fix it?

1

There are 1 answers

2
ScottC On BEST ANSWER

There is a problem with the server. I even tried to use their own Run button on their website and got the same message:

Image

When running other API calls, there was no error, so I think there is just an issue with this specific API call.