# Facebook

> Facebook. 8 outils, avec leurs paramètres et des exemples d’appel.

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

Outils de l’agent Facebook : annonces Marketplace et groupes publics, lus en direct.

Chaque appel est une requête `POST` avec la clé en `Authorization: Bearer`. Le corps JSON est l’entrée de l’outil, et la réponse a la forme `{ "tool": "nom", "output": … }`. Les exemples ne portent que les paramètres requis. Les descriptions des paramètres sont celles que lisent les agents, en anglais.

### `findMarketplaceLocation`

Convertit un nom de ville ou de zone en coordonnées Marketplace.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `query` | `string` | Oui | 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`

Cherche des annonces Marketplace publiques par mot-clé autour d’un lieu (ville ou coordonnées), sur 3 pages au plus.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `query` | `string` | Oui | Search keyword(s) |
| `location` | `string` | Non | City or area name; ignored when lat and lng are both given |
| `lat` | `number` | Non |  |
| `lng` | `number` | Non |  |
| `radiusKm` | `integer` | Non |  |
| `minPrice` | `number` | Non |  |
| `maxPrice` | `number` | Non |  |
| `count` | `integer` | Non |  |
| `pages` | `integer` | Non | Pages to chain in one call (1 credit each); dedupes listings |
| `sortBy` | `suggested \| creation_time_descend \| distance_ascend \| price_ascend \| price_descend` | Non |  |
| `delivery` | `all \| local_pickup \| shipping` | Non |  |
| `condition` | `new \| used_like_new \| used_good \| used_fair` | Non |  |
| `dateListed` | `all \| last_24_hours \| last_7_days \| last_30_days` | Non |  |
| `availability` | `available \| sold \| all` | Non |  |
| `categoryId` | `string` | Non | Numeric Marketplace category id, as returned in listings |
| `exclude` | `array<string>` | Non | Drop listings whose title contains any of these words (e.g. 'pièces', 'cadre seul') |
| `include` | `array<string>` | Non | Keep only listings whose title contains at least one of these words |
| `cursor` | `string` | Non | 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`

Détail d’une annonce : description, attributs, photos, livraison, date exacte quand Facebook la donne.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `listing` | `string` | Oui | 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`

Détail de 2 à 6 annonces à la fois, sous forme de tableau comparatif.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `listings` | `array<string>` | Oui | 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`

Fiche publique d’un groupe : confidentialité, taille, activité, catégories, règles.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `group` | `string` | Oui | 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`

Publications d’un groupe public, par pages de 3 (6 pages au plus).

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `group` | `string` | Oui | Group URL, numeric id, or vanity slug |
| `sortBy` | `CHRONOLOGICAL \| CHRONOLOGICAL_LISTINGS \| TOP_POSTS \| RECENT_ACTIVITY` | Non |  |
| `pages` | `integer` | Non |  |
| `keywords` | `array<string>` | Non | Keep only posts containing at least one of these terms |
| `since` | `string` | Non | ISO date; posts older than this are dropped and chronological paging stops there |
| `cursor` | `string` | Non |  |

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

Détail d’une publication ou d’un reel public : texte, auteur, date, réactions, vues.

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `post` | `string` | Oui | 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`

Commentaires d’une publication publique, filtrables par mots-clés (3 pages au plus).

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

Type : Lecture en direct. Scopes : `explore`.

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `post` | `string` | Oui | Post or reel URL |
| `pages` | `integer` | Non |  |
| `keywords` | `array<string>` | Non |  |
| `cursor` | `string` | Non |  |

```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"]
```
