# Search Real-Time Data — Dappier

> Perform a real-time web/data search using a Dappier AI model (POST /app/aimodel/{ai_model_id}). Returns an AI-generated message synthesized from live web data. Provide an aiModelId (prefix am_, e.g. am_01j06ytn18ejftedz6dyhz2b15) - NOTE…

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

## Description

Perform a real-time web/data search using a Dappier AI model (POST `/app/aimodel/{ai_model_id}`). Returns an AI-generated `message` synthesized from live web data. Provide an `aiModelId` (prefix `am_`, e.g. `am_01j06ytn18ejftedz6dyhz2b15`) - NOTE this endpoint takes AI-model IDs (`am_`), NOT data-model IDs (`dm_`); for `dm_` data models use **Get AI Recommendations** instead. There is no listing endpoint in the Dappier API; discover valid model IDs in the Dappier Marketplace at https://platform.dappier.com/marketplace. [See the documentation](https://docs.dappier.com/api-reference/endpoint/real-time-search).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `aiModelId` | `string` | Yes | The Dappier AI model ID to query (prefix am_, e.g. am_01j06ytn18ejftedz6dyhz2b15). This is an AI-model ID, distinct from the dm_ data-model IDs used by Get AI Recommendations. Discover valid IDs in the Dappier Marketplace: https://platform.dappier.com/marketplace (the Dappier API exposes no listing endpoint). |
| `query` | `string` | Yes | The natural-language search query or prompt to run against the real-time model. Example: latest AI news. |

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

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: "dappier-search-real-time-data",
  arguments: {
    aiModelId: "AI Model ID",
    query: "Query",
  },
})
```

**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: "dappier-search-real-time-data",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    dappier: { authProvisionId: "apn_xxxxxxx" },
    aiModelId: "AI Model ID",
    query: "Query",
  },
})

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": "dappier-search-real-time-data",
    "configured_props": {
      "dappier": { "authProvisionId": "apn_xxxxxxx" },
      "aiModelId": "AI Model ID",
      "query": "Query"
    }
  }'
```

---

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