> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RapidAPI: Request

> Call any endpoint of a supported RapidAPI listing, with your own method, path, query and body, when no dedicated tool covers it.

Call any endpoint of a supported RapidAPI listing, with your own method, path, query and body, when no dedicated tool covers it.

> [!NOTE]
>
> Tool ID: `rapidapi_request`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'rapidapi_request',
  {
    "host": "api.example.com",
    "path": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute rapidapi_request --input '{
  "host": "api.example.com",
  "path": "example"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "listing": {
    "slug": "example",
    "host": "api.example.com",
    "label": "example"
  },
  "method": "example",
  "path": "example",
  "status_code": 123,
  "ok": true,
  "billed_requests": 1,
  "data": {}
}
```

Use `deepline describe rapidapi_request --json` for the latest machine-readable contract.

## Input reference

Call one endpoint on a RapidAPI listing that Deepline has registered and priced.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.host` | `string` | Yes | — | RapidAPI listing host such as real-time-google-search-api.p.rapidapi.com, or just its slug. Only listings Deepline has registered and priced can be called. run rapidapi\_list\_listings to see them. Minimum length: 1. |
| `payload.method` | `"GET" \| "POST"` | No | — | HTTP method. Defaults to GET. Allowed: `GET`, `POST`. |
| `payload.path` | `string` | Yes | — | Endpoint path on the listing host, for example /api/v1/google-search/web. Put query-string values in query, not in the path. Minimum length: 1. |
| `payload.query` | `record` | No | — | Query-string parameters. |
| `payload.body` | `unknown` | No | — | JSON request body. Only valid with method POST. |
| `payload.timeout_ms` | `integer` | No | — | Per-request timeout in milliseconds. Defaults to 30000. Minimum: 1000. Maximum: 120000. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Call one endpoint on a RapidAPI listing that Deepline has registered and priced.",
    "properties": {
      "host": {
        "type": "string",
        "description": "RapidAPI listing host such as real-time-google-search-api.p.rapidapi.com, or just its slug. Only listings Deepline has registered and priced can be called; run rapidapi_list_listings to see them.",
        "minLength": 1
      },
      "method": {
        "type": "string",
        "description": "HTTP method. Defaults to GET.",
        "enum": [
          "GET",
          "POST"
        ]
      },
      "path": {
        "type": "string",
        "description": "Endpoint path on the listing host, for example /api/v1/google-search/web. Put query-string values in query, not in the path.",
        "minLength": 1
      },
      "query": {
        "type": "object",
        "description": "Query-string parameters.",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          ]
        }
      },
      "body": {
        "description": "JSON request body. Only valid with method POST."
      },
      "timeout_ms": {
        "type": "integer",
        "description": "Per-request timeout in milliseconds. Defaults to 30000.",
        "minimum": 1000,
        "maximum": 120000
      }
    },
    "required": [
      "host",
      "path"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.listing` | `object` | Yes | — | — |
| `result.listing.slug` | `string` | Yes | — | — |
| `result.listing.host` | `string` | Yes | — | — |
| `result.listing.label` | `string` | Yes | — | — |
| `result.method` | `string` | Yes | — | — |
| `result.path` | `string` | Yes | — | — |
| `result.status_code` | `integer` | Yes | — | — |
| `result.ok` | `boolean` | Yes | — | True for a 2xx upstream response. 404 and 410 are returned with ok=false instead of failing the call. |
| `result.billed_requests` | `integer` | Yes | — | Requests the listing reported in its X-RapidAPI-Billing header, or null when the header was absent. |
| `result.data` | `unknown` | Yes | — | Upstream response body as returned. |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "listing": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "host",
          "label"
        ],
        "additionalProperties": false
      },
      "method": {
        "type": "string"
      },
      "path": {
        "type": "string"
      },
      "status_code": {
        "type": "integer"
      },
      "ok": {
        "type": "boolean",
        "description": "True for a 2xx upstream response. 404 and 410 are returned with ok=false instead of failing the call."
      },
      "billed_requests": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Requests the listing reported in its X-RapidAPI-Billing header, or null when the header was absent."
      },
      "data": {
        "description": "Upstream response body as returned."
      }
    },
    "required": [
      "listing",
      "method",
      "path",
      "status_code",
      "ok",
      "billed_requests",
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0` per pricing unit.

## Related documentation

* [RapidAPI provider guide](https://deepline.com/docs/providers/rapidapi/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.