endpoint

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

How to correctly call the API endpoint with Python 3 without getting error 500? Question: 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 …

Total answers: 2

How should I organize my path operations in FastAPI?

How should I organize my path operations in FastAPI? Question: I am creating an application with FastAPI and so far it goes like this: But I’m having a problem with the endpoints. The /api/items/filter route has two query parameters: name and category. However, it gives me the impression that it is being taken as if …

Total answers: 1

BSC websocket endpoint lantency

BSC websocket endpoint lantency Question: I’m recently trying to monitor transactions of a contract address on BSC chain for my dex limit order and I finally found a stable solution to monitor the log event — ‘using web sockect connection’. bsc = "wss://ws-nd-112-055-480.p2pify.com/xxxxxxxxxxxxxxxxxxx" web3 = Web3(Web3.WebsocketProvider(bsc)) poolAdd = ‘0x0eD7e52944161450477ee417DE9Cd3a859b14fD0’ block_filter = web3.eth.filter({‘fromBlock’: ‘latest’, ‘address’: poolAdd, …

Total answers: 3

FastAPI conflict path parameter in endpoint – good practices?

FastAPI conflict path parameter in endpoint – good practices? Question: I am creating 2 GET methods for a resource student using FastAPI. I’m looking to GET a student in 2 ways: by student_id or by student_name. The issue is that, I initially created the 2 endpoints as follows @app.get("/student/{student_name}", response_model=schemas.Student, status_code=200) def get_student_by_name(student_name: str, db: …

Total answers: 3