# Search Videos — Invidious

> Search for videos on Invidious. See the documentation

- Key: `invidious-search`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Invidious (`invidious`) — https://pipedream.com/apps/invidious.md
- This page (HTML): https://pipedream.com/apps/invidious/actions/search
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/invidious/actions/search/search.mjs

## Description

Search for videos on Invidious. [See the documentation](https://docs.invidious.io/api/#get-apiv1search)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `q` | `string` | Yes | The query to search for videos. |
| `sort` | `string` | No | The criteria to sort the search results by. |
| `date` | `string` | No | The date to filter the search results by. |
| `type` | `string` | No | The type of videos to search for. Default: all |
| `features` | `string[]` | No | The features to filter the search results by. (comma separated: e.g. hd,subtitles,3d,live |
| `region` | `string` | No | ISO 3166 country code (default: US) |

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

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: "invidious-search",
  arguments: {
    q: "Search Query",
    sort: "Sort By",
  },
})
```

**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: "invidious-search",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    invidious: { authProvisionId: "apn_xxxxxxx" },
    q: "Search Query",
    sort: "Sort By",
  },
})

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": "invidious-search",
    "configured_props": {
      "invidious": { "authProvisionId": "apn_xxxxxxx" },
      "q": "Search Query",
      "sort": "Sort By"
    }
  }'
```

---

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