> ## 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

> 주어진 URL이나 파일에서 시계열 데이터를 추출

URL 또는 업로드된 파일(PDF, Markdown)에서 시계열 데이터를 추출합니다. 시간이 매겨진 이벤트나 사실의 목록을 시간순으로 정리해 반환합니다.

## 엔드포인트

| 메서드    | 경로                        | 입력                                |
| ------ | ------------------------- | --------------------------------- |
| `POST` | `/api/v1/timeseries`      | `url`을 포함한 JSON 본문                |
| `POST` | `/api/v1/timeseries/file` | `file`을 포함한 `multipart/form-data` |

***

## POST /api/v1/timeseries

### 요청 본문

<ParamField body="url" type="string" required>
  시계열 데이터를 추출할 페이지 또는 문서 URL.
</ParamField>

<ParamField body="language" type="string">
  추출된 데이터 포인트 label의 언어 (예: `english`, `korean`). timestamp는 ISO 포맷 (`YYYY`, `YYYY-MM`, `YYYY-MM-DD`)으로 유지됩니다. 기본값: 영어.
</ParamField>

<ParamField body="limit" type="number" default="50">
  추출할 시계열 데이터 포인트의 최대 개수. 범위: 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

### 요청 본문 (multipart/form-data)

<ParamField body="file" type="file" required>
  시계열 데이터를 추출할 PDF 또는 Markdown 파일.
</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>

***

## 응답

<ResponseField name="title" type="string">
  시계열에 대한 추론된 제목 또는 설명입니다.
</ResponseField>

<ResponseField name="dataPoints" type="array">
  시간순으로 정렬된 시계열 데이터 포인트 목록입니다.

  <Expandable title="Data point fields">
    <ResponseField name="timestamp" type="string">정규화된 타임스탬프: `YYYY`, `YYYY-MM`, 또는 `YYYY-MM-DD` 중 하나</ResponseField>
    <ResponseField name="label" type="string">해당 시점의 이벤트 또는 사실에 대한 설명</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="Meta fields">
    <ResponseField name="total" type="number">전체 데이터 포인트 수</ResponseField>
    <ResponseField name="executionTimeMs" type="number">응답 시간(밀리초)</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>
