# Scrape Single URL — Apify (OAuth)

> 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

- Key: `apify_oauth-scrape-single-url`
- Type: Action (Write)
- Version: 0.0.3
- App: Apify (OAuth) (`apify_oauth`) — https://pipedream.com/apps/apify-oauth.md
- This page (HTML): https://pipedream.com/apps/apify-oauth/actions/scrape-single-url
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/apify_oauth/actions/scrape-single-url/scrape-single-url.mjs

## Description

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](https://docs.apify.com/sdk/js/docs/examples/crawl-single-url)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | Yes | The URL of the web page to scrape. |
| `crawlerType` | `string` | Yes | Select the crawling engine: Headless web browser - Useful for modern websites with anti-scraping protections and JavaScript rendering. It recognizes common blocking patterns like CAPTCHAs and automatically retries blocked requests through new sessions. However, running web browsers is more expensive as it requires more computing resources and is slower. It is recommended to use at least 8 GB of RAM. Stealthy web browser (default) - Another headless web browser with anti-blocking measures enabled. Try this if you encounter bot protection while scraping. For best performance, use with Apify Proxy residential IPs. Raw HTTP client - High-performance crawling mode that uses raw HTTP requests to fetch the pages. It is faster and cheaper, but it might not work on all websites. |

## Run it

**MCP**

```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()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "apify_oauth-scrape-single-url",
  arguments: {
    url: "URL",
    crawlerType: "Crawler Type",
  },
})
```

**TypeScript**

```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-scrape-single-url",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    apify_oauth: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    crawlerType: "Crawler Type",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "apify_oauth-scrape-single-url",
    "configured_props": {
      "apify_oauth": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "crawlerType": "Crawler Type"
    }
  }'
```

---

- App: https://pipedream.com/apps/apify-oauth.md · All apps: https://pipedream.com/apps
