# Scrape Page — FireCrawl

> Scrapes a URL and returns content from that page. See the documentation

- Key: `firecrawl-scrape-page`
- Type: Action (Write)
- Version: 1.0.4
- App: FireCrawl (`firecrawl`) — https://pipedream.com/apps/firecrawl.md
- This page (HTML): https://pipedream.com/apps/firecrawl/actions/scrape-page
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/firecrawl/actions/scrape-page/scrape-page.mjs

## Description

Scrapes a URL and returns content from that page. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/scrape)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | Yes | The URL to scrape |
| `formats` | `string[]` | No | Formats to include in the output |
| `onlyMainContent` | `boolean` | No | Only return the main content of the page, excluding headers, navs, footers, etc. |
| `includeTags` | `string[]` | No | Tags to include in the output |
| `excludeTags` | `string[]` | No | Tags to exclude from the output |
| `headers` | `object` | No | Headers to send with the request. Can be used to send cookies, user-agent, etc. |
| `waitFor` | `integer` | No | Specify a delay in milliseconds before fetching the content, allowing the page sufficient time to load. |
| `mobile` | `boolean` | No | Set to true to emulate scraping from a mobile device. Useful for testing responsive pages and taking mobile screenshots |
| `timeout` | `integer` | No | Timeout in milliseconds for the request |
| `additionalOptions` | `object` | No | Additional parameters to send in the request. See the documentation for available parameters. Values will be parsed as JSON where applicable. |

## 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": "firecrawl",
      },
    },
  },
)

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: "firecrawl-scrape-page",
  arguments: {
    url: "URL",
    formats: ["Formats"],
  },
})
```

**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: "firecrawl-scrape-page",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    firecrawl: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    formats: ["Formats"],
  },
})

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": "firecrawl-scrape-page",
    "configured_props": {
      "firecrawl": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "formats": ["Formats"]
    }
  }'
```

---

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