# Facebook

> Facebook。8 個のツールを、パラメーターと呼び出し例とともに掲載しています。

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

Facebook エージェントのツールです。Marketplace の出品と公開グループをライブで読み取ります。

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

### `findMarketplaceLocation`

都市または地域の名前を、Marketplace の座標に変換します。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `query` | `string` | はい | City or area name, e.g. 'Lyon' or 'Austin, Texas' |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/findMarketplaceLocation \
  -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/findMarketplaceLocation", {
  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/findMarketplaceLocation",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "query": "levée de fonds",
    },
)
output = response.json()["output"]
```

### `searchMarketplace`

ある場所（都市または座標）の周辺で、キーワードにより Marketplace の公開出品を検索します。最大 3 ページ。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `query` | `string` | はい | Search keyword(s) |
| `location` | `string` | いいえ | City or area name; ignored when lat and lng are both given |
| `lat` | `number` | いいえ |  |
| `lng` | `number` | いいえ |  |
| `radiusKm` | `integer` | いいえ |  |
| `minPrice` | `number` | いいえ |  |
| `maxPrice` | `number` | いいえ |  |
| `count` | `integer` | いいえ |  |
| `pages` | `integer` | いいえ | Pages to chain in one call (1 credit each); dedupes listings |
| `sortBy` | `suggested \| creation_time_descend \| distance_ascend \| price_ascend \| price_descend` | いいえ |  |
| `delivery` | `all \| local_pickup \| shipping` | いいえ |  |
| `condition` | `new \| used_like_new \| used_good \| used_fair` | いいえ |  |
| `dateListed` | `all \| last_24_hours \| last_7_days \| last_30_days` | いいえ |  |
| `availability` | `available \| sold \| all` | いいえ |  |
| `categoryId` | `string` | いいえ | Numeric Marketplace category id, as returned in listings |
| `exclude` | `array<string>` | いいえ | Drop listings whose title contains any of these words (e.g. 'pièces', 'cadre seul') |
| `include` | `array<string>` | いいえ | Keep only listings whose title contains at least one of these words |
| `cursor` | `string` | いいえ | Opaque cursor from a previous page |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/searchMarketplace \
  -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/searchMarketplace", {
  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/searchMarketplace",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "query": "levée de fonds",
    },
)
output = response.json()["output"]
```

### `getMarketplaceListing`

出品の詳細。説明、属性、写真、配送、Facebook が提供する場合は正確な日付。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `listing` | `string` | はい | Listing id or Marketplace item URL |

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

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

### `getMarketplaceListings`

2〜6 件の出品の詳細を、比較表としてまとめて取得します。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `listings` | `array<string>` | はい | Listing ids or Marketplace item URLs |

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

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

### `getFacebookGroup`

公開グループのプロフィール。プライバシー設定、規模、活動、カテゴリ、ルール。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `group` | `string` | はい | Group URL, numeric id, or vanity slug |

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

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

### `getFacebookGroupPosts`

公開グループの投稿を、3 件ずつのページで取得します（最大 6 ページ）。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `group` | `string` | はい | Group URL, numeric id, or vanity slug |
| `sortBy` | `CHRONOLOGICAL \| CHRONOLOGICAL_LISTINGS \| TOP_POSTS \| RECENT_ACTIVITY` | いいえ |  |
| `pages` | `integer` | いいえ |  |
| `keywords` | `array<string>` | いいえ | Keep only posts containing at least one of these terms |
| `since` | `string` | いいえ | ISO date; posts older than this are dropped and chronological paging stops there |
| `cursor` | `string` | いいえ |  |

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

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

### `getFacebookPost`

公開投稿またはリールの詳細。テキスト、投稿者、日付、リアクション、再生数。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `post` | `string` | はい | Post or reel URL |

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

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

### `getFacebookPostComments`

公開投稿のコメントを、キーワードで絞り込んで取得します（最大 3 ページ）。

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

種類: ライブ読み取り。スコープ: `explore`。

| パラメーター | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `post` | `string` | はい | Post or reel URL |
| `pages` | `integer` | いいえ |  |
| `keywords` | `array<string>` | いいえ |  |
| `cursor` | `string` | いいえ |  |

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

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