skillfed

apify

Apify SDK for Python

apify v4.0.1 273.1K downloads/30d#8,205 on PyPI175
Permissive license Apache-2.0 Active released

What it is and what it does

Apify SDK is the official Python framework for building Actors—serverless programs that run on the Apify platform or locally. It wraps your code in an async context manager that handles initialization, teardown, error recovery, and platform lifecycle events automatically. The SDK provides built-in access to storage (datasets, key-value stores, request queues), proxy routing, platform events, and the full Apify API through a preconfigured client.

You write a simple async function inside `async with Actor:`, and the SDK handles everything else: reading validated input, writing results to storage, reacting to platform signals, and managing Actor execution state. It works with any Python library you already use—web scrapers like Crawlee or Scrapy, browser automation tools like Playwright, AI frameworks, or custom code. The SDK is designed to let you focus on your business logic while Apify handles deployment, scaling, monitoring, and pay-per-event billing.

Use it for:

  • Build and deploy web scrapers and crawlers that run on the Apify platform with automatic scaling and monitoring.
  • Create browser automation workflows using Playwright or Selenium, packaged as serverless Actors for cloud execution.
  • Host AI agents or LLM-powered applications as Actors, with templates for LangGraph, CrewAI, and PydanticAI.
  • Run web servers or HTTP APIs inside Actors to expose scrapers or other services as live endpoints.
  • Deploy MCP (Model Context Protocol) servers as Actors to make tools available to any MCP client.
  • Automate repetitive tasks with scheduled Actor runs, webhooks, and inter-Actor communication.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Apify SDK for Python is the official framework for building and running Apify Actors—serverless programs that handle web scraping, browser automation, AI agents, and other cloud-deployed tasks with built-in lifecycle management, storage access, and platform integration.

Yes. The SDK is actively maintained, has no known vulnerabilities, uses a permissive license, and requires only Python 3.11+. Install it if you plan to build Actors on the Apify platform or want a framework that bundles serverless lifecycle management, storage, and proxy handling. Skip it if you only need to consume the Apify API from existing code—use apify-client instead, which comes bundled with this SDK.

Install

apify on PyPI

pip

pip install apify

uv

uv add apify

poetry

poetry add apify

Installing apify

Before you install

Low install friction with a pure-wheel distribution. Actively maintained with a release 7 days ago and a commit history through 2026-08-14. Requires Python 3.11 or higher, which aligns with current language support.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for both open-source and proprietary projects.

Quickstart

pip install apify

from apify import Actor

async def main() -> None:
    async with Actor:
        actor_input = await Actor.get_input()
        Actor.log.info('Actor input: %s', actor_input)
        await Actor.set_value('OUTPUT', 'Hello, world!')

Requires Python 3.11 or higher. Async context manager pattern is mandatory for Actor lifecycle management.

Verify before relying

  • Whether the 11 runtime dependencies (apify-client, crawlee, pydantic, cryptography, websockets, etc.) are all required for basic usage or if some are optional.
  • Performance characteristics and scaling limits when running locally versus on the Apify platform.
  • Detailed compatibility matrix with popular scraping libraries (Scrapy, Crawlee, Playwright, Selenium) mentioned in the description.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 11 — apify-client, crawlee, cachetools, cryptography, impit, lazy-object-proxy, more-itertools, pydantic, typing-extensions, websockets, yarl
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 273,121/month — #8,205 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: apify-4.0.1-py3-none-any.whl

Keywords: apify, sdk, automation, chrome, crawlee, crawler, headless, scraper, scraping

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: LibrariesTyping :: Typed

Tags

apify actor sdk pythonserverless web scraping frameworkpython actor platformcloud automation sdkdistributed task runner pythonweb crawler deployment platformasync actor lifecycle management
serverless-automationweb-scrapingactor-framework

More Libraries packages