Skip to main content
POST
https://api.evergreens.ai
/
v1
/
networks
/
browser
/
elements
{
  "urls": ["https://example.com"],
  "elements": ["h1", "a", "img"]
}
{
  "isCached": true,
  "cacheExpiresIn": 7200,
  "results": {
    "https://evergreen.media": {
      "h1": [],
      "a": ["Home", "About Us", "Contact"],
      "img": ["http://evergreen.media/image1.png"]
    }
  }
}
Extract elements from a page using Tedi Browser network component. Entity Reference:
ElementEntity
Examples
There is two types of request modes you can use with Tedi Browser Elements API:
  • Elements mode: Directly specify the element selectors you want to extract from the web pages.
  • Prompt mode: Provide a natural language prompt to guide the extraction process.
When using Elements mode, then you have to specify the elements field with an array of element selectors. When using Prompt mode, then you have to specify the prompt field with a natural language instruction. In this mode, it is required to also provide the output schema to define the expected structure of the extracted data.

Request

urls
string[]
required
An array of URLs to extract elements from.
  • Minimum of 1 URL per request.
  • Maximum of 10 URLs per request.
elements
ElementEntity[] | string[]
An array of element selectors to extract from the specified URLs.See ElementEntity for detailed configuration options.
prompt
string
An optional prompt to guide the extraction process. When provided, Tedi will use this prompt to determine which elements to extract based on the context of the web pages.
output
object
Optional JSON Schema (Draft 7) that defines the expected structure of the response. This allows you to specify how you want the extracted information to be organized and formatted.
cache
object
An optional object to configure caching behavior for the request. By default, caching is enabled with a TTL of 120 seconds. You can customize these settings by providing the cache object.

Response

The response will contain the extracted elements for each URL specified in the request.
isCached
boolean
default:true
Indicates whether the response was served from cache.
cacheExpiresIn
number
default:7200
The time in seconds until the cached response expires. Default is 7200 seconds (2 hours).
results
Record<string, <Record<URL, string[]>>>
required
A mapping of each URL to its extracted elements. Each URL maps to another object where keys are element selectors and values are arrays of extracted content.
usage
object
An object containing token usage information for the request. This will be returned if you use Agentic features with Tedi Browser Elements.
{
  "urls": ["https://example.com"],
  "elements": ["h1", "a", "img"]
}
{
  "isCached": true,
  "cacheExpiresIn": 7200,
  "results": {
    "https://evergreen.media": {
      "h1": [],
      "a": ["Home", "About Us", "Contact"],
      "img": ["http://evergreen.media/image1.png"]
    }
  }
}