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

# Introduction

> Programmatically retrieve political monitoring data and AI-generated monitoring reports using the Parsagon Search API.

## Overview

The Parsagon Search API gives you programmatic access to a daily-updated dataset of legislation, regulations, and other government publications across 70+ countries.

We currently have active coverage for the following countries:

Argentina, Australia, Austria, Belgium, Brazil, Bulgaria, Canada, Chile, China, Colombia, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Dominican Republic, Ecuador, Egypt, Estonia, European Union, Finland, France, Germany, Greece, Hong Kong, Hungary, India, Indonesia, Ireland, Israel, Italy, Japan, Kazakhstan, Kenya, Kuwait, Latvia, Lithuania, Malaysia, Malta, Mexico, Netherlands, New Zealand, Nigeria, Norway, Peru, Philippines, Poland, Portugal, Qatar, Romania, Saudi Arabia, Singapore, Slovakia, Slovenia, South Africa, South Korea, Spain, Sweden, Switzerland, Taiwan, Thailand, Turkey, Turkmenistan, Ukraine, United Arab Emirates, United Kingdom, United States, Uruguay, Uzbekistan, Vietnam

If you need coverage for a jurisdiction we don't currently list, we can typically add it quickly.

We can ingest and deliver essentially any publicly available government material (where available in a jurisdiction), including:

* Legislation
* Regulations
* Consultations
* Guidance
* Enforcement actions
* Press releases and announcements
* Speeches
* Mainstream business/political news

## Methods

The API provides three ways to retrieve data:

**Quick Search** runs an ad-hoc search and returns results immediately. Use this for one-off queries over a window of up to 72 hours. No persistent object is created.

**Advanced Search** creates a persistent Search object and processes it asynchronously. It supports date ranges up to 90 days and can produce an AI-generated report alongside raw results. Poll the returned `id` to retrieve results once processing is complete.

**Get Category Sources** returns the full chronological list of all sources collected for a given data category, without any AI filtering or summarization. Use this to retrieve raw, unfiltered data for a specific category, covering up to the last 90 days.

## Base URL

All endpoints are relative to:

```text theme={null}
https://parsagon.io/api/events/v1/
```

## Authentication

All requests must be authenticated using an API key.

Include your API key in the `Authorization` HTTP header, prefixed with `Token` and a space:

```http theme={null}
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
```

You can view and manage your API key by logging into Parsagon and visiting your [settings](https://parsagon.io/settings) page.

## Content types

Request bodies must be sent as JSON:

```http theme={null}
Content-Type: application/json
```

Responses are returned as JSON.

## Shared request schema

Both **Quick Search** and **Advanced Search** use the same request body schema.

<ParamField body="categories" type="array" required>
  Array of category IDs to include in the search results.
</ParamField>

<ParamField body="context" type="string">
  Additional context for the AI to tailor the search and reporting (for example, your organization or focus area). Maximum 1000 characters.
</ParamField>

<ParamField body="filter_prompt" type="string" required>
  A description of what to search for. This should be a list of policy topics, one per line — longer, descriptive phrases work best. Maximum 5000 characters.

  ```text Example filter_prompt theme={null}
  Government funding and subsidies for aerospace R&D innovation
  Workforce development and skills programs for aerospace manufacturing, engineering, and skilled labour
  Regulations governing aviation safety, environmental impact, and emissions standards
  ```
</ParamField>

<ParamField body="is_test" type="boolean">
  Set to `true` to validate the request without running a source search. Quick Search returns example data immediately. Advanced Search creates a dummy Search object; retrieve it with Get Search to read the dummy data. Required fields such as `categories`, `filter_prompt`, and `date_range` are still validated normally.
</ParamField>

<ParamField body="test_data" type="object">
  Optional dummy data to use when `is_test` is `true`. If omitted, Parsagon returns built-in example search results.

  <Expandable title="Test data fields">
    <ParamField body="search_results" type="array">
      Custom search results to use instead of the built-in examples.
    </ParamField>

    <ParamField body="edited_results" type="any">
      Custom edited output for Advanced Search. Quick Search does not support `edited_results`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="date_range" type="object" required>
  Constrains the time period for documents. Specify either a fixed range (`start_date` and `end_date`) or a relative duration (`duration_seconds`).

  <Expandable title="Fixed range">
    <ParamField body="start_date" type="string">
      ISO 8601 datetime (UTC). The earliest supported value is 90 days before the time of the request.
    </ParamField>

    <ParamField body="end_date" type="string">
      ISO 8601 datetime (UTC).
    </ParamField>
  </Expandable>

  <Expandable title="Relative duration">
    <ParamField body="duration_seconds" type="number">
      Positive number of seconds before "now" to search within.
    </ParamField>
  </Expandable>
</ParamField>

### Date range limits

| Endpoint        | Maximum window                                  |
| --------------- | ----------------------------------------------- |
| Quick Search    | 72 hours (3 days) — `duration_seconds` ≤ 259200 |
| Advanced Search | 90 days — `duration_seconds` ≤ 7776000          |

For all search types, the earliest supported `start_date` is **90 days** before the time of the request. Historical data older than 90 days is available upon request.

**Example request body:**

```json theme={null}
{
  "categories": [1, 2],
  "context": "User is a Government Relations Manager for an aerospace company in the UK.",
  "filter_prompt": "Government funding and subsidies for aerospace R&D innovation\nWorkforce development and skills programs for aerospace manufacturing, engineering, and skilled labour\nRegulations governing aviation safety, environmental impact, and emissions standards",
  "date_range": {
    "duration_seconds": 259200
  }
}
```

## Test mode

Use `is_test: true` to test request validation and response handling without running a source search or report generation task.

* Quick Search can return built-in example `search_results` or custom `test_data.search_results`.
* Advanced Search returns a dummy Search object. Use its `id` with Get Search to retrieve built-in example `search_results`, custom `test_data.search_results`, and custom `test_data.edited_results`.
* Create Report returns a dummy Report object with built-in example `result` data or custom `test_data.result`.
* `test_data` can only be used when `is_test` is `true`.
* Required fields are still validated normally. For Search endpoints, this includes `categories`, `filter_prompt`, and `date_range`. For Create Report, this includes `topic`, `structure`, `audience`, and `length`.

```json Example test request body theme={null}
{
  "categories": [1],
  "context": "User is testing an API integration.",
  "filter_prompt": "Example policy updates",
  "date_range": {
    "duration_seconds": 86400
  },
  "is_test": true,
  "test_data": {
    "search_results": [
      {
        "url": "https://example.com/policy-update",
        "title": "Example policy update",
        "summary": "Example summary returned in test mode.",
        "date": "2026-02-03",
        "type": "ARTICLE"
      }
    ]
  }
}
```

```json Example report test request body theme={null}
{
  "topic": "Financial services regulatory developments in the UK",
  "structure": "Executive summary, key developments, and implications",
  "audience": "Government relations team",
  "length": "SHORT_MEMO",
  "is_test": true,
  "test_data": {
    "result": {
      "text": "# Example report\n\nExample report content returned in test mode.",
      "html": "<h1>Example report</h1><p>Example report content returned in test mode.</p>",
      "type": "html"
    }
  }
}
```
