The one idea
An API call is just your Python script making an HTTP request and using the response. Treat it like a file read that can fail because the network, URL, key, or server may be wrong.
What you need
Most API work in Python uses the requests package. It is not part of the Python standard library, so it must go into requirements.txt.
For hackathon projects, use a real API if you have one. If keys or credits are an issue, use a mock API while keeping the same code shape.