Search1API
Advanced

Extract (Beta)

Extract structured data from a URL based on a prompt and schema. Every request costs 10 credits.

POST
/extract

Authorization

AuthorizationRequiredBearer <token>

In: header

Request Body

application/jsonRequired

Parameters for data extraction

urlRequiredTarget URL

The URL of the web page to extract data from.

Format: "url"
promptRequiredExtraction Prompt

Natural language instructions describing what data to extract.

response_formatRequiredResponseFormat

Defines the desired format of the extracted data.

Response Body

Successful Extraction

TypeScript Definitions

Use the response body type in TypeScript.

successRequiredSuccess Status

Indicates whether the extraction was successful.

extractParametersRequiredEchoedExtractParameters
resultsRequiredExtraction Results

The extracted data, structured according to the 'json_schema' provided in the request.

curl -X POST "https://api.search1api.com/extract" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://sports.yahoo.com/nba/scoreboard/?confId=&dateRange=2025-04-11",
    "prompt": "Extract all head-to-head match results including date, teams, final scores, and halftime scores if available.",
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "type": "object",
        "properties": {
          "matches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "home_team": {
                  "type": "string"
                },
                "away_team": {
                  "type": "string"
                },
                "home_score": {
                  "type": "integer"
                },
                "away_score": {
                  "type": "integer"
                }
              },
              "required": [
                "date",
                "home_team",
                "away_team",
                "home_score",
                "away_score"
              ]
            }
          }
        },
        "required": [
          "matches"
        ]
      }
    }
  }'
{
  "success": true,
  "extractParameters": {
    "url": "https://sports.yahoo.com/nba/scoreboard/?confId=&dateRange=2025-04-11"
  },
  "results": {
    "matches": [
      {
        "date": "2025-04-11",
        "home_team": "Philadelphia76ers",
        "away_team": "AtlantaHawks",
        "home_score": 110,
        "away_score": 124
      },
      {
        "date": "2025-04-11",
        "home_team": "IndianaPacers",
        "away_team": "OrlandoMagic",
        "home_score": 115,
        "away_score": 129
      }
    ]
  }
}