Go to example tasks

Run a Python data-processing snippet

Runs a Python 3 snippet in an isolated sandbox: it loads a JSON object from standard input and returns the total, max, min and average of a `numbers` array as JSON. The output is parsed into the `result` field. Replace `code` and `stdin` with your own logic; the run is capped at a short timeout.

Try for free
AI Code Runner Sandbox
AI Code Runner Sandboxparsebird/code-runner-sandbox
Status
Language
Exit code
Signal
+6 fields
Text
Number
Boolean
List
Object

Input

Language:python
Code(required):import sys, json d = json.load(sys.stdin) n = d["numbers"] print(json.dumps({"total": sum(n), "max": max(n), "min": min(n), "avg": sum(n)/len(n)}))
Standard input:{"numbers": [10, 20, 30, 40, 55]}
Timeout (seconds):5

Output fields

Status
Language
Exit code
Signal
Duration (ms)
Timed out
Output truncated
Termination reason
Result parse error
Executed at

How it works

Sign up on Apify or log in

The AI Code Runner Sandbox Actor is ready to run with the inputs already set for "Run a Python data-processing snippet". Sign up or log in and you'll land in Apify Console with a copy of this exact task.

Start the "Run a Python data-processing snippet" task

The AI Code Runner Sandbox Actor will start running based on the input automatically. You can also change all the input fields, like language, code, and more, to match your specific use case.

Receive the "Run a Python data-processing snippet" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, language, exit code, and more.

Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "Run a Python data-processing snippet" task via API.

Image

Integrate "Run a Python data-processing snippet" into your workflow

Connect "Run a Python data-processing snippet" with 100+ integrations, or run it via API or MCP.

Webhook

Webhook

n8n

n8n

Make

Make

Zapier

Zapier

Airbyte

Airbyte

Keboola

Keboola

IFTTT

IFTTT

Hubspot

Hubspot

GDrive

GDrive

Gmail

Gmail

Apify MCP

Apify MCP

GitHub

GitHub

Slack

Slack

LangChain

LangChain

LlamaIndex

LlamaIndex

Flowise

Flowise

Pinecone

Pinecone

OpenAI

OpenAI

Mastra

Mastra

Clay

Clay