# クイックスタート

> URL: https://foura.ai/ja/docs/getting-started/quick-start
> Updated: 2026-09-27
> Index: https://foura.ai/llms.txt

2分未満で最初のデータ収集を開始できます。

## 前提条件

- FourAアカウント ([こちらから登録](https://foura.ai))
- APIキー ([Dashboard](https://foura.ai/dashboard)で作成)

## ステップ 1: APIキーの取得

[Dashboard](https://foura.ai/dashboard)にサインインしてAPIキーを作成します。形式は次のとおりです: `pk_live_a1b2c3d4e5f6...`

コピーしてください。すべてのrequestで必要になります。

## ステップ 2: 最初のrequestを実行する

ターミナルを開き、以下を実行します (`YOUR_API_KEY`を実際のキーに置き換えてください):

```bash
curl -X POST https://eu.api.foura.ai/api/single/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method": "GET", "url": "https://example.com"}'
```

これにより、`example.com` へ HTTP request が送信され、ページの HTML が返されます。

## ステップ 3: response の確認

```json
{
  "status": 200,
  "headers": [
    {
      "result": { "version": "HTTP/2", "code": 200, "reason": "" },
      "content-type": "text/html; charset=UTF-8",
      "content-length": "1256"
    }
  ],
  "data": "<!doctype html><html>...</html>",
  "total_time": 0.45
}
```

`headers`フィールドは、リダイレクトホップごとのオブジェクト配列です。各エントリには`result`フィールドが含まれ、ステータスラインとそのホップでターゲットが返したすべてのresponse headerが保持されます。

主要フィールド:
- `status`: ターゲットサイトからのHTTPステータスコード
- `data`: response body（HTML、JSON、またはraw text）
- `total_time`: request所要時間（秒）

## ステップ 4: 異なるendpointを試す

FourAには、さまざまな状況に対応する4つのendpointがあります:

| Endpoint | Speed | Use when |
|----------|-------|----------|
| `POST /api/auto/` | 変動（ウォームホストでは高速） | サイトに必要なエンジンが不明な場合。URLを渡せば、FourAが機能する最も低コストなパスを選択します。 |
| `POST /api/single/` | 最速（200ms〜2s） | 静的ページ、API、サーバーサイドレンダリングサイト |
| `POST /api/browser/` | 中速（2s〜10s） | JavaScriptを多用するページ、SPA、動的コンテンツ |
| `POST /api/proxy/` | 高速（1s〜5s） | リクエスト元を検証するサイト、国によって内容が異なるコンテンツ |

auto request（スマートなデフォルト設定）を試す:

```bash
curl -X POST https://eu.api.foura.ai/api/auto/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/product/42",
    "validate": {"data": {"accept": ["Add to cart"]}}
  }'
```

ブラウザ request を試す:

```bash
curl -X POST https://eu.api.foura.ai/api/browser/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "timeout_ms": 15000}'
```

proxy request（自動 proxy ローテーション）を試す:

```bash
curl -X POST https://eu.api.foura.ai/api/proxy/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "maxTries": 3,
    "request": {
      "method": "GET",
      "url": "https://example.com",
      "unblocker": true
    }
  }'
```

## 次のステップ

- [認証](https://foura.ai/docs/getting-started/authentication): APIキーの管理とセキュリティ
- [APIエンドポイント](https://foura.ai/docs/api/endpoints): 全4つのエンドポイントに関する完全なパラメータリファレンス
- [スマートフェッチ (Auto)](https://foura.ai/docs/guides/smart-fetch): autoエンドポイントの動作決定ロジック
- [SDKとライブラリ](https://foura.ai/docs/getting-started/sdks-and-libraries): Python、Node.js、Go、Rubyでのコード例
- [最適なエンドポイントの選択](https://foura.ai/docs/guides/choosing-task-type): auto、single、browser、proxyの使い分け
