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
- Live Scrape: The system initiates a request to your test URL using the provided config.
- Data Extraction: It applies your
extract_schemeto the live page content. - Quality Check: The system evaluates the results for extraction quality and only saves if so.
Example Request
curl -X POST https://scrape.evomi.com/api/v1/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.
{
"success": true,
"scheme_id": "sch_xxxx",
"message": "Quality adequate: 0/4 empty (0.0%)",
"scrape_result": {
"extraction": [
{"label": "title", "content": "Example Domain"},
]
}
}