# Apify (OAuth) — Pipedream Connect

> Apify is the place to find, develop, buy and run cloud programs called actors. Use actors to turn any website into an API.

- API slug: `apify_oauth` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Developer Tools
- Website: https://apify.com
- Managed OAuth scopes: `full_api_access`
- This page (HTML): https://pipedream.com/apps/apify-oauth
- Tools: 7 actions · 2 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: apify_oauth`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "apify_oauth",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Get Dataset Items:
const result = await mcp.callTool({
  name: "apify_oauth-get-dataset-items",
  arguments: {
    datasetId: "Dataset ID",
    clean: true,
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Apify (OAuth) endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "apify_oauth-get-dataset-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    apify_oauth: { authProvisionId: "apn_xxxxxxx" },
    datasetId: "Dataset ID",
    clean: true,
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (7)

### `apify_oauth-get-dataset-items` — Get Dataset Items (Read-only)

Returns data stored in a dataset. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/get-dataset-items.md

### `apify_oauth-get-kvs-record` — Get Key-Value Store Record (Read-only)

Gets a record from a key-value store. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/get-kvs-record.md

### `apify_oauth-run-actor` — Run Actor (Write)

Performs an execution of a selected Actor in Apify. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/run-actor.md

### `apify_oauth-run-task` — Run Task (Write)

Run a specific task and optionally wait for its termination. Not for use with Pipedream Connect. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/run-task.md

### `apify_oauth-run-task-synchronously` — Run Task Synchronously (Write)

Run a specific task and return its dataset items. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/run-task-synchronously.md

### `apify_oauth-scrape-single-url` — Scrape Single URL (Write)

Executes a scraper on a specific website and returns its content as HTML. This action is perfect for extracting content from a single page. See the documentation

Full schema: https://pipedream.com/apps/apify-oauth/actions/scrape-single-url.md

### `apify_oauth-set-key-value-store-record` — Set Key-Value Store Record (Write)

Create or update a record in an Apify Key-Value Store. Supports strings, numbers, booleans, null, arrays, and objects. Automatically infers content type (JSON vs. plain text).

Full schema: https://pipedream.com/apps/apify-oauth/actions/set-key-value-store-record.md

## Triggers (2)

### `apify_oauth-new-finished-actor-run-instant` — New Finished Actor Run (Instant) (Instant)

Emit new event when a selected Actor is run and finishes.

Full schema: https://pipedream.com/apps/apify-oauth/triggers/new-finished-actor-run-instant.md

### `apify_oauth-new-finished-task-run-instant` — New Finished Task Run (Instant) (Instant)

Emit new event when a selected task is run and finishes.

Full schema: https://pipedream.com/apps/apify-oauth/triggers/new-finished-task-run-instant.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
