Example Code Runner (Python)
Pricing
Pay per usage
Go to Apify Store
Example Code Runner (Python)
Python Actor to run code examples from the documentation via "Run on Apify" links.
Pricing
Pay per usage
Rating
4.5
(3)
Developer
Apify
Maintained by ApifyActor stats
1
Bookmarked
1.3K
Total users
25
Monthly active users
7 days ago
Last modified
Categories
Share
The Actor behind the "Run on Apify" buttons in Python documentation, such as crawlee.dev/python and docs.apify.com. It takes a Python snippet as input and runs it, so a single Actor can execute code samples from both the Apify SDK and Crawlee.
Input
| Field | Type | Description |
|---|---|---|
code | string | Python code to execute. Must define a main function (sync or async). |
{"code": "async def main() -> None:\n print('Hello world!')\n"}
If the snippet uses Actor, the runner hands over its own Actor context so the code can manage its lifecycle (SDK examples create their own context; Crawlee examples don't).
Run locally
This is a uv-managed project. You'll also need the Apify CLI.
uv syncapify run -i '{"code": "async def main() -> None:\n print(\"hi\")\n"}'
Deploy to Apify
apify login # once, with your API tokenapify push # build and deploy the Actor


