# Lecture en direct

> Explorer le web et les registres en direct. 9 outils, avec leurs paramètres et des exemples d’appel.

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

Lectures en direct sur le web et les réseaux publics. Elles consomment des crédits ; rien n’est stocké dans le workspace.

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.

### `readPage`

Lit une page web publique : titre, texte principal (6 000 caractères), flux découverts et 30 liens.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `url` | `string` | Oui |  |

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

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

### `searchWeb`

Recherche sur le web public pour trouver des URL candidates.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `query` | `string` | Oui |  |
| `limit` | `integer` | Non |  |

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

### `browserRead`

Lit une page dynamique ou protégée avec un navigateur forcé. Même forme que `readPage`.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `url` | `string` | Oui |  |

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

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

### `waybackHistory`

Captures Wayback Machine d’une URL : première capture et captures récentes.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `url` | `string` | Oui |  |

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

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

### `registryLookup`

Recherche une entreprise dans un registre public : Sirene (France), EDGAR (États-Unis), Companies House (Royaume-Uni) ou OpenCorporates.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `registry` | `sirene \| edgar \| companies_house \| opencorporates` | Oui |  |
| `query` | `string` | Oui |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/registryLookup \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"registry":"sirene","query":"levée de fonds"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/registryLookup", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "registry": "sirene",
    "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/registryLookup",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "registry": "sirene",
        "query": "levée de fonds",
    },
)
output = response.json()["output"]
```

### `socialCatalog`

Liste les endpoints de lecture des réseaux sociaux (40 au plus), filtrables par plateforme.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `platform` | `string` | Non |  |

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

### `socialCall`

Appelle un endpoint de lecture des réseaux sociaux et renvoie jusqu’à 20 items compacts.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `endpointId` | `string` | Oui |  |
| `params` | `object` | Oui |  |

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

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

### `previewSource`

Échantillon en direct (5 à 10 items) d’une source, avant de s’y abonner.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `platform` | `instagram \| tiktok \| youtube \| twitter \| x \| threads \| linkedin \| reddit \| …` | Oui |  |
| `target` | `string` | Oui |  |
| `kind` | `page \| group \| marketplace \| profile \| live \| company \| search` | Non |  |

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

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

### `whoSaidItFirst`

Qui a publié une information en premier sur le web, page par page, et quand vos sources l’ont vue. Part d’un sujet ou d’un item ; gardée comme frise privée du workspace.

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

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

| Paramètre | Type | Requis | Description |
| --- | --- | --- | --- |
| `query` | `string` | Non |  |
| `itemId` | `string` | Non |  |

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