# Add Tasks

Add LaCentrale listing URLs to check their status

Add LaCentrale listing URLs to your **LaCentrale Listing Status Checker** squid. Each task checks whether the listing is still active or has been deactivated or expired.

<Note>Crawler ID: `1d7fbb550feb1cf93e3e439039bcd687`</Note>

## Headers

<ParamField header="Authorization" type="string" required>
  Your API authentication token. Value: `Token YOUR_API_KEY`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be application/json. Value: `application/json`
</ParamField>

## Body

<ParamField body="squid" type="string" required>
  Hash ID of your squid.
</ParamField>

<ParamField body="tasks" type="array" required>
  Array of task objects. Each task must include a `url` field.
</ParamField>

## Task Fields

<ParamField body="tasks[].url" type="string" required>
  LaCentrale listing URL. Example: `https://www.lacentrale.fr/auto-occasion-annonce-66103802227.html`
</ParamField>

<Note>
  Only `auto-occasion-annonce` URLs are supported. The URL must match the pattern `lacentrale.fr/auto-occasion-annonce-{id}.html`.
</Note>

## Code Examples

<CodeGroup>
```bash cURL
curl -X POST "https://api.lobstr.io/v1/tasks" \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squid": "YOUR_SQUID_HASH",
    "tasks": [
      { "url": "https://www.lacentrale.fr/auto-occasion-annonce-66103802227.html" },
      { "url": "https://www.lacentrale.fr/auto-occasion-annonce-66104112345.html" }
    ]
  }'
```

```python Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}

squid_id = "YOUR_SQUID_HASH"

listing_urls = [
    "https://www.lacentrale.fr/auto-occasion-annonce-66103802227.html",
    "https://www.lacentrale.fr/auto-occasion-annonce-66104112345.html",
]

response = requests.post(f"{BASE_URL}/tasks",
    headers=headers,
    json={
        "squid": squid_id,
        "tasks": [{"url": url} for url in listing_urls]
    }
)

data = response.json()
print(f"Added {len(data['tasks'])} tasks")
print(f"Duplicates skipped: {data['duplicated_count']}")
```
</CodeGroup>

## Response

```json 200
{
  "duplicated_count": 0,
  "tasks": [
    {
      "id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
      "created_at": "2026-06-02T10:00:00.000000",
      "is_active": true,
      "params": {
        "url": "https://www.lacentrale.fr/auto-occasion-annonce-66103802227.html"
      },
      "object": "task"
    }
  ]
}
```
