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

# Integrate

> Get code snippets for an endpoint

Get ready-to-use code snippets for integrating an API endpoint into your application.

## Request

<ParamField body="api" type="string" required>
  API slug (e.g., "olostep", "hunter")
</ParamField>

<ParamField body="path" type="string" required>
  Endpoint path (e.g., "/v1/scrapes")
</ParamField>

<ParamField body="format" type="string" default="orth-sdk">
  Code format to return:

  | Value         | Description               |
  | ------------- | ------------------------- |
  | `orth-sdk`    | Orthogonal TypeScript SDK |
  | `run-api`     | Direct HTTP to /v1/run    |
  | `curl`        | cURL command              |
  | `x402-fetch`  | x402 payment (JavaScript) |
  | `x402-python` | x402 payment (Python)     |
  | `all`         | All available formats     |
</ParamField>

## Response

```json theme={null}
{
  "success": true,
  "api": {
    "name": "Olostep",
    "slug": "olostep"
  },
  "endpoint": {
    "path": "/v1/scrapes",
    "method": "POST",
    "price": "$0.005"
  },
  "format": "all",
  "snippets": {
    "orth-sdk": "import Orthogonal from \"@orth/sdk\";\n\nconst orthogonal = new Orthogonal(...);\nconst result = await orthogonal.run({...});",
    "run-api": "curl -X POST 'https://api.orthogonal.com/v1/run' ...",
    "curl": "curl -X POST 'https://api.orthogonal.com/v1/run' ...",
    "x402-fetch": "import { wrapFetchWithPayment } from \"x402-fetch\"; ...",
    "x402-python": "from x402.clients.requests import x402_http_adapter ..."
  },
  "setup": {
    "sdk": "npm install @orth/sdk && export ORTHOGONAL_API_KEY=orth_live_...",
    "x402": "npm install x402-fetch viem && export PRIVATE_KEY=0x..."
  }
}
```

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://api.orthogonal.com/v1/integrate' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "api": "hunter",
      "path": "/domain-search",
      "format": "all"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.orthogonal.com/v1/integrate', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ORTHOGONAL_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      api: 'hunter',
      path: '/domain-search',
      format: 'curl'
    })
  });

  const { snippets } = await response.json();
  console.log(snippets.curl);
  ```

  ```python Python theme={null}
  import requests
  import os

  response = requests.post(
      'https://api.orthogonal.com/v1/integrate',
      headers={'Authorization': f'Bearer {os.environ["ORTHOGONAL_API_KEY"]}'},
      json={'api': 'hunter', 'path': '/domain-search', 'format': 'all'}
  )

  snippets = response.json()['snippets']
  ```
</CodeGroup>
