# コーパス

> コーパスとワークスペースを読む。22 個のツールを、パラメーターと呼び出し例とともに掲載しています。

Source: https://piqline.com/ja/docs/api/reference/corpus

Piqline エージェントのツールです。ワークスペースがすでに収集した内容を読み取ります。クレジットは使わず、何も書き込みません。

各呼び出しは `POST` リクエストで、キーは `Authorization: Bearer` に入れます。JSON の本文がツールの入力で、レスポンスは `{ "tool": "nom", "output": … }` の形式です。例には必須パラメーターだけを入れています。パラメーターの説明は、エージェントが読むものと同じです。

### `getCoverageStats`

収集量とその状態。合計、プラットフォーム別と種類別の内訳、分析期間（`1h`、`24h`、`7d`、`30d`）の取り込み推移。

`POST https://piqline.com/api/v1/tools/getCoverageStats`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `period` | `1h \| 24h \| 7d \| 30d` | いいえ | Analysis window |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getCoverageStats \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getCoverageStats", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getCoverageStats",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listSources`

ワークスペースが追跡しているソース。アイテム数、状態、最終読み取りを含みます。

`POST https://piqline.com/api/v1/tools/listSources`

種類: 読み取り。スコープ: `read`。

このツールにパラメーターはありません。空の本文 `{}` を送信してください。

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listSources \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listSources", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listSources",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `searchItems`

アイテム（投稿、動画、記事、広告、求人）を、テキスト、プラットフォーム、種類、ソースで絞り込んで検索します。絞り込みがない場合は、最新のアイテムを返します（最大 40 件）。

`POST https://piqline.com/api/v1/tools/searchItems`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `query` | `string` | いいえ | Free-text match on title and body |
| `platform` | `string` | いいえ |  |
| `itemType` | `post \| video \| article \| listing \| job_offer` | いいえ |  |
| `sourceId` | `string` | いいえ |  |
| `limit` | `integer` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/searchItems \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/searchItems", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/searchItems",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getItem`

アイテムの詳細。テキスト、文字起こし、OCR、検出されたトピック、意味の近いアイテム、観測日。

`POST https://piqline.com/api/v1/tools/getItem`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `itemId` | `string` | はい |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getItem \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"itemId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getItem", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "itemId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getItem",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "itemId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    },
)
output = response.json()["output"]
```

### `searchPassages`

長い文書（Motor が読み取った PDF）を意味で検索します。質問に最も近い箇所を、アイテム、ページ、セクション見出しとともに返します。

`POST https://piqline.com/api/v1/tools/searchPassages`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `query` | `string` | はい | Question or phrase to look for |
| `itemId` | `string` | いいえ | Limit to one document |
| `limit` | `integer` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/searchPassages \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"levée de fonds"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/searchPassages", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "query": "levée de fonds"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/searchPassages",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "query": "levée de fonds",
    },
)
output = response.json()["output"]
```

### `citeItem`

ある箇所がアイテム内に一字一句そのまま存在することを確認し、引用番号を返します。存在しない場合は、最も近い箇所を返します。チャットの引用モードの基盤です。

`POST https://piqline.com/api/v1/tools/citeItem`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `itemId` | `string` | はい | Item id from searchItems or getItem |
| `quote` | `string` | はい | Exact passage copied from the item text |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/citeItem \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"itemId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70","quote":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/citeItem", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "itemId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    "quote": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/citeItem",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "itemId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
        "quote": "texte",
    },
)
output = response.json()["output"]
```

### `drawDiagram`

回答を SVG の図（タイムライン、マトリクス、フロー、ツリーなど）として描画します。色はテーマのロールに従い、SVG は表示前にサニタイズされます。チャットの図モードの基盤です。

`POST https://piqline.com/api/v1/tools/drawDiagram`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `type` | `architecture \| flowchart \| sequence \| state \| timeline \| swimlane \| quadrant \| tree \| …` | はい | Visual type chosen for the layout |
| `title` | `string` | はい | Short name of the subject, in the user's language |
| `description` | `string` | はい | One sentence on what the diagram shows, for screen readers and the caption |
| `svg` | `string` | はい | A single <svg viewBox="0 0 960 H">…</svg> following the diagram rules |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/drawDiagram \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"architecture","title":"texte","description":"texte","svg":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/drawDiagram", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "type": "architecture",
    "title": "texte",
    "description": "texte",
    "svg": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/drawDiagram",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "type": "architecture",
        "title": "texte",
        "description": "texte",
        "svg": "texte",
    },
)
output = response.json()["output"]
```

### `createCanvas`

キャンバス（piqline/canvas SDK だけをインポートする TSX ファイル）をコンパイルし、表示可能なコード、または修正すべきエラーを返します。チャットのキャンバスモードとレポートモードの基盤です。

`POST https://piqline.com/api/v1/tools/createCanvas`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `title` | `string` | はい | Short title shown above the canvas, in French |
| `source` | `string` | はい | Full .canvas.tsx source |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/createCanvas \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"texte","source":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/createCanvas", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "title": "texte",
    "source": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/createCanvas",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "title": "texte",
        "source": "texte",
    },
)
output = response.json()["output"]
```

### `getTopics`

検出されたトピックと発言シェア、およびストーリー（複数のソースで見られる同じ話題）。

`POST https://piqline.com/api/v1/tools/getTopics`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `period` | `1h \| 24h \| 7d \| 30d` | いいえ | Analysis window |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getTopics \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getTopics", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getTopics",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getSignals`

ワークスペースの継続ルールによって発火した、未解決のシグナル。リードタイムとステータス付き。

`POST https://piqline.com/api/v1/tools/getSignals`

種類: 読み取り。スコープ: `read`。

このツールにパラメーターはありません。空の本文 `{}` を送信してください。

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getSignals \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getSignals", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getSignals",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listWorkspaceTables`

ワークスペースに作成済みのテーブル。名前、コメント、列数と行数、テーブルが自動で埋まるかどうか。

`POST https://piqline.com/api/v1/tools/listWorkspaceTables`

種類: 読み取り。スコープ: `read`。

このツールにパラメーターはありません。空の本文 `{}` を送信してください。

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWorkspaceTables \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listWorkspaceTables", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listWorkspaceTables",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getWorkspaceTable`

ワークスペースのテーブルを JSON で返します。スキーマ、列、行を含みます。サイト、アプリ、エージェントの土台やフィードとして使えます（read スコープ）。

`POST https://piqline.com/api/v1/tools/getWorkspaceTable`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `schema` | `string` | いいえ | Schema, default public. |
| `name` | `string` | はい | Table name. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getWorkspaceTable \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getWorkspaceTable", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getWorkspaceTable",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
    },
)
output = response.json()["output"]
```

### `listBookmarks`

ワークスペースのヴォールトにあるブックマークとフォルダー。タイトル、種類、フォルダー、ステータス、受け入れ状況。単語、ステータス、種類での絞り込みも可能です。

`POST https://piqline.com/api/v1/tools/listBookmarks`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `query` | `string` | いいえ | Optional filter on title, note or tags. |
| `status` | `inbox \| reading \| done` | いいえ |  |
| `kind` | `item \| source \| signal \| graph \| search \| document \| board \| chat` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listBookmarks \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listBookmarks", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listBookmarks",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listEntities`

追跡中のエンティティ（企業、ブランド、公開アカウント）と、期間内に関連付けられたアイテム。

`POST https://piqline.com/api/v1/tools/listEntities`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `period` | `7d \| 30d \| 90d` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listEntities \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listEntities", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listEntities",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listWatchContracts`

ソースに設定されたウォッチ契約。意図、残す語と除外する語、イベント。

`POST https://piqline.com/api/v1/tools/listWatchContracts`

種類: 読み取り。スコープ: `read`。

このツールにパラメーターはありません。空の本文 `{}` を送信してください。

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWatchContracts \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listWatchContracts", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listWatchContracts",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `checkInvestigation`

最新の Edge 調査、または指定した調査のステータス。保留中、実行中、候補付きの完了、失敗のいずれか。

`POST https://piqline.com/api/v1/tools/checkInvestigation`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `missionId` | `string` | いいえ | Omit to read the latest investigator mission of this workspace |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/checkInvestigation \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/checkInvestigation", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/checkInvestigation",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `checkHunt`

最新のハント、または指定したハントのステータス。段階、見つかった人物（コードの判定とあなたの判定）、各条件のステータスと日付付きの公開証拠（URL、日付、抜粋）。連絡先は返しません。

`POST https://piqline.com/api/v1/tools/checkHunt`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `missionId` | `string` | いいえ | Omit to read the latest hunt of this workspace. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/checkHunt \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/checkHunt", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/checkHunt",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `planSourcePack`

目的に合わせて、追跡するソースのまとまりを提案します。何も作成しません。

`POST https://piqline.com/api/v1/tools/planSourcePack`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `name` | `string` | はい |  |
| `rationale` | `string` | はい | Why this pack answers the goal |
| `candidates` | `array<object>` | はい |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/planSourcePack \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"texte","rationale":"texte","candidates":[{"platform":"instagram","target":"texte","label":"texte","why":"texte","confidence":"high"}]}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/planSourcePack", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "texte",
    "rationale": "texte",
    "candidates": [
      {
        "platform": "instagram",
        "target": "texte",
        "label": "texte",
        "why": "texte",
        "confidence": "high"
      }
    ]
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/planSourcePack",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
        "rationale": "texte",
        "candidates": [
            {
                "platform": "instagram",
                "target": "texte",
                "label": "texte",
                "why": "texte",
                "confidence": "high",
            },
        ],
    },
)
output = response.json()["output"]
```

### `listWidgets`

このワークスペースのボードに置けるウィジェット。利用者に合わせて順位付けし、理由を添えます。

`POST https://piqline.com/api/v1/tools/listWidgets`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `period` | `7d \| 30d \| 90d` | いいえ | Window used by isProposable. Default 7d. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWidgets \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listWidgets", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listWidgets",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getAdvertiserCampaigns`

ワークスペースの収集結果から得た広告主の広告ファイル。広告、配信中の広告、日付、ライブラリ、国、読み取ったニーズ、月ごとの新規広告とランプアップ、最新の広告、シグナル。人物は対象外です。クレジットは使いません。

`POST https://piqline.com/api/v1/tools/getAdvertiserCampaigns`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `advertiser` | `string` | はい | Name (or part of it) of the advertiser. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getAdvertiserCampaigns \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"advertiser":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getAdvertiserCampaigns", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "advertiser": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/getAdvertiserCampaigns",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "advertiser": "texte",
    },
)
output = response.json()["output"]
```

### `listAdSignals`

ワークスペースの広告シグナル（1 時間ごとに計算）。キャンペーンの開始と停止、ランプアップ、新しい国、新しいプラットフォーム、有料の求人、プロモーション、ローンチ、新しい広告主。クレジットは使いません。

`POST https://piqline.com/api/v1/tools/listAdSignals`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `kind` | `ad_campaign_started \| ad_campaign_stopped \| ad_ramp_up \| ad_new_country \| ad_new_platform \| ad_hiring \| ad_promotion \| ad_launch \| …` | いいえ | ad_hiring for paid recruitment campaigns, ad_campaign_started for new campaigns, etc. |
| `activeOnly` | `boolean` | いいえ |  |
| `limit` | `integer` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listAdSignals \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listAdSignals", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listAdSignals",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listCollectedAds`

ワークスペースで収集済みの広告コレクション（Meta、TikTok、Google、LinkedIn）。一覧を返します。コレクション名を指定すると、その内訳（切り口、オファー、トーン、フォーマット）、ペース、最も長く配信されている広告、ライブラリ、ステータス、切り口、単語で絞り込んだ広告を返します。クレジットは使いません。

`POST https://piqline.com/api/v1/tools/listCollectedAds`

種類: 読み取り。スコープ: `read`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `collection` | `string` | いいえ | Name of a collection (exact, start or fragment). |
| `library` | `meta \| tiktok \| google \| linkedin` | いいえ |  |
| `status` | `live \| new` | いいえ | live: active or shown within 14 days. new: first seen at the last pass. |
| `angle` | `promotion \| lancement \| marque \| preuve_sociale \| education \| recrutement \| evenement \| lead \| …` | いいえ |  |
| `query` | `string` | いいえ | Word to find in the advertiser, title, text, button or transcript. |
| `limit` | `integer` | いいえ |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listCollectedAds \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/listCollectedAds", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/listCollectedAds",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```
