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

# Timeseries

> Extract time-series data from a given URL or file.

Extract time-series data from a URL or uploaded file (PDF, Markdown). Returns a list of timestamped events or facts, organized chronologically.

## Endpoints

| Method | Path                      | Input                             |
| ------ | ------------------------- | --------------------------------- |
| `POST` | `/api/v1/timeseries`      | JSON body with `url`              |
| `POST` | `/api/v1/timeseries/file` | `multipart/form-data` with `file` |

***

## POST /api/v1/timeseries

### Request Body

<ParamField body="url" type="string" required>
  URL of the page or document to extract time-series data from.
</ParamField>

<ParamField body="language" type="string">
  Language for the extracted data point labels (e.g. `english`, `korean`). Timestamps remain in ISO formats (`YYYY`, `YYYY-MM`, `YYYY-MM-DD`). Defaults to English.
</ParamField>

<ParamField body="limit" type="number" default="50">
  Maximum number of time-series data points to extract. Range: 1–100.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.factagora.com/api/v1/timeseries" \
    -H "Authorization: Bearer fag_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{"url": "https://data.worldbank.org/indicator/NY.GDP.MKTP.CD?locations=US"}'
  ```
</RequestExample>

***

## POST /api/v1/timeseries/file

### Request Body (multipart/form-data)

<ParamField body="file" type="file" required>
  PDF or Markdown file to extract time-series data from.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.factagora.com/api/v1/timeseries/file" \
    -H "Authorization: Bearer fag_your_api_key" \
    -F "file=@report.pdf"
  ```
</RequestExample>

***

## Response

<ResponseField name="title" type="string">
  Inferred title or description of the time-series.
</ResponseField>

<ResponseField name="dataPoints" type="array">
  List of time-series data points, sorted chronologically.

  <Expandable title="Data point fields">
    <ResponseField name="timestamp" type="string">Normalized timestamp in one of: `YYYY`, `YYYY-MM`, or `YYYY-MM-DD`</ResponseField>
    <ResponseField name="label" type="string">Description of the event or fact at this point in time</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="Meta fields">
    <ResponseField name="total" type="number">Total number of data points</ResponseField>
    <ResponseField name="executionTimeMs" type="number">Response time in milliseconds</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "title": "AI Regulation Timeline",
    "dataPoints": [
      { "timestamp": "2023-03", "label": "Italy temporarily bans ChatGPT over privacy concerns" },
      { "timestamp": "2023-06", "label": "EU Parliament passes draft AI Act" },
      { "timestamp": "2023-10", "label": "US Executive Order on AI safety signed by Biden" },
      { "timestamp": "2024-03", "label": "EU AI Act formally adopted" },
      { "timestamp": "2024-08", "label": "EU AI Act enters into force" },
      { "timestamp": "2025-02", "label": "First prohibited AI systems banned under EU AI Act" }
    ],
    "meta": {
      "total": 6,
      "executionTimeMs": 520
    }
  }
  ```
</ResponseExample>
