Test XPath attributes against stored HTML
POST
/api/v1/extraction/test-xpath
const url = 'https://dashboard.justcrawl.io/api/v1/extraction/test-xpath';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"domain":"example","pageType":"example","attributes":[{"name":"example","xpaths":["example"],"type":"text","description":"example","antiPatterns":["example"],"semanticType":"brand_name","validation":{"minLength":1,"maxLength":1,"min":1,"max":1,"pattern":"example"}}],"jobId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.justcrawl.io/api/v1/extraction/test-xpath \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "domain": "example", "pageType": "example", "attributes": [ { "name": "example", "xpaths": [ "example" ], "type": "text", "description": "example", "antiPatterns": [ "example" ], "semanticType": "brand_name", "validation": { "minLength": 1, "maxLength": 1, "min": 1, "max": 1, "pattern": "example" } } ], "jobId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Re-runs extraction using the supplied attributes against either the specified job’s cached HTML, or the most recent job for the domain.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
domain
required
string
pageType
required
string
attributes
required
Array<object>
object
name
required
string
xpaths
required
Array<string>
type
required
string
description
string
antiPatterns
Array<string>
semanticType
string
validation
object
minLength
integer
maxLength
integer
min
number
max
number
pattern
string
jobId
Optional. If omitted, uses the most recent job with stored HTML for the domain.
string format: uuid
Responses
Section titled “ Responses ”Extracted values and quality score
Media type application/json
object
values
object
key
additional properties
any
qualityScore
object
completeness
number
validation
number
composite
number
jobId
string
url
string
Example generated
{ "values": {}, "qualityScore": { "completeness": 1, "validation": 1, "composite": 1 }, "jobId": "example", "url": "example"}Validation error
No HTML available for domain or job
HTML blob exceeds 5MB limit