# Test

Source: https://docs.evomi.com/scraping-products-instructions/scraper-api/parameters/extraction/schema/test/

Set `test=true` to validate your `extract_scheme` against a live target URL before the system saves it. If `success=False` is false the scheme configuration will not be saved.

## Validation Parameters
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `test` | boolean | **Yes** | Set to `true` to enable validation. |
| `config.url` | string | **Yes** | The live URL to test your selectors against. |
| `config.extract_scheme` | array | **Yes** | The scheme you want to verify (unless `fix=true`). |

---

## How It Works Simplfied

1. **Live Scrape**: The system initiates a request to your test URL using the provided config.
2. **Data Extraction**: It applies your `extract_scheme` to the live page content.
3. **Quality Check**: The system evaluates the results for extraction quality and only saves if so.

---

## Example Request
```bash
curl -X POST https://scrape.evomi.com/api/v1/account/schemes \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Live Test scheme",
    "test": true,
    "config": {
      "url": "https://example.com",
      "extract_scheme": [
        {
          "label": "title", 
          "selector": "h1", 
          "type": "content"
        }
      ]
    }
  }'
```

---

## Response Format
A successful test returns the extraction results and the confirmed `scheme_id`.

```json
{
  "success": true,
  "scheme_id": "sch_xxxx",
  "message": "Quality adequate: 0/4 empty (0.0%)",
  "scrape_result": {
    "extraction": [
      {"label": "title", "content": "Example Domain"},

    ]
  }
}
