> For the complete documentation index, see [llms.txt](https://docs.orbitfin.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orbitfin.ai/orbit-api-reference/api/document-search.md).

# Document Search

Search across filing documents using semantic or keyword search.

#### Endpoint

```
POST /search/documents
```

#### Parameters

| Parameter         | Type      | Required | Description                                  |
| ----------------- | --------- | -------- | -------------------------------------------- |
| query             | string    | Yes      | Search query (natural language or keywords)  |
| orbit\_entity\_id | string\[] | No       | Limit to specific companies                  |
| report\_type      | string\[] | No       | Limit to specific report types               |
| date\_range       | object    | No       | {"start": "2024-01-01", "end": "2024-12-31"} |
| search\_type      | string    | No       | semantic, keyword, hybrid (default: hybrid)  |
| limit             | integer   | No       | Max results (default: 20, max: 20)           |

#### Example Request

bash

```bash
curl -X POST "https://api.orbitfin.ai/v1/search/documents" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "artificial intelligence investments",
    "orbit_entity_id": ["ent_2vxp8q3n", "ent_7kms9p2w"],
    "search_type": "semantic",
    "limit": 10
  }'
```

#### Response

json

```json
{
  "status": "success",
  "credits_used": 1.0,
  "data": {
    "total_matches": 47,
    "returned_count": 10,
    "results": [
      {
        "score": 0.92,
        "report_id": "rpt_9xk3m7nq",
        "company_name": "Apple Inc.",
        "report_type": "10-K",
        "section": "Item 1A - Risk Factors",
        "page": 23,
        "snippet": "...our investments in artificial intelligence and machine learning technologies...",
        "context": {
          "before": "We continue to make significant",
          "match": "investments in artificial intelligence and machine learning technologies",
          "after": "to enhance our products and services"
        }
      }
    ]
  }
}
```
