"Get All Cross Margin Pairs" bizarre error

I am trying to get all the cross margin pairs with a public request:
requests.get(‘https://api.binance.com/sapi/v1/margin/allPairs’).json()

I’m getting this error response: {‘code’: -2014, ‘msg’: ‘API-key format invalid.’}

What API key? this is a public request. In the api documentation it clearly says that no parameters are required for this request.

Can anyone please help?

Thank you.

This endpoint requires API key in the request header. Please find the details in the document:

https://binance-docs.github.io/apidocs/spot/en/#get-all-margin-assets-market_data