Execute async Python
POST/code/async-python
This endpoint runs Python code in a Linux sandbox using the CPython interpreter. In contrast to the normal Python endpoint, this endpoint returns immediately, and the result of your code is sent to a webhook. You can return data using the print
statement. To import dependencies, first add all the dependencies to the requirements
array, and then import them using the common import
statement. All dependencies will be automatically downloaded and installed for you, with the exception of native system dependencies. There is a time limit of 30 minutes and a memory limit of 512MB applied to your code, which also includes the dependency download process. The execution of this module costs 50 credits for every started 3 minutes of execution, so at least 50 and at most 500 credits.
Request
Header Parameters
- application/json
Bodyrequired
The Python script that will be executed.
The PyPI libraries your Python code requires.
The system dependencies your Python code requires. These will be installed using apk, the Alpine Package manager.
The URL of the webhook the response will be sent to.
Responses
- 200
- 400
Success
- application/json
- Schema
- Example (auto)
Schema
{
"status": "string",
"taskId": "string"
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
{
"status": 0,
"errorMessage": "string"
}