Forums

API Documentation

The help page for the PythonAnywhere needs more detail. It doesn't mention anything about the actual structure of the JSON responses.

We're aware that the API documentation needs work, but if you need to know what the responses look like, you can just make a request to the API and look at the response to see what its structure is.

I guess I could do it myself. Having the JSON structures on the help page would save time. We also need to describe how errors work (e.g. possible values for the detail field)

Those are both good points.

I already made a pull request to the help pages repo

Unfortunately, that's not very useful. The API docs are auto-generated from comments in the API code and your changes would just be overwritten the next time we updated from that. We will take what you have written and work it into those comments at some point.

Close the pull request then

I'm working on a wrapper around this API. This is how you use it to list all consoles:

>>> from pyanywhere.users import get_current_user
>>> user = get_current_user()
>>> for console in user.get_consoles():
...     print(console.name)
...
Bash console 14000012
Bash console 14042069