contextdev

package module
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

README

Context Dev Go API Library

Go Reference

The Context Dev Go library provides convenient access to the Context Dev REST API from applications written in Go.

It is generated with Stainless.

MCP Server

Use the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/context-dot-dev/context-go-sdk/v2" // imported as contextdev
)

Or to pin the version:

go get -u 'github.com/context-dot-dev/context-go-sdk@v2.6.0'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/context-dot-dev/context-go-sdk/v2"
	"github.com/context-dot-dev/context-go-sdk/v2/option"
)

func main() {
	client := contextdev.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("CONTEXT_DEV_API_KEY")
	)
	brand, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", brand.Brand)
}

Request fields

The contextdev library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, contextdev.String(string), contextdev.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := contextdev.ExampleParams{
	ID:   "id_xxx",                 // required property
	Name: contextdev.String("..."), // optional property

	Point: contextdev.Point{
		X: 0,                 // required field will serialize as 0
		Y: contextdev.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: contextdev.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[contextdev.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := contextdev.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Brand.Get(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *contextdev.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{
	OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
		Domain: "stripe.com",
	},
})
if err != nil {
	var apierr *contextdev.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/brand/retrieve": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Brand.Get(
	ctx,
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper contextdev.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := contextdev.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Brand.Get(
	context.TODO(),
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
brand, err := client.Brand.Get(
	context.TODO(),
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", brand)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: contextdev.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := contextdev.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (CONTEXT_DEV_API_KEY, CONTEXT_DEV_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type AIExtractProductParams

type AIExtractProductParams struct {
	// The product page URL to extract product data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (AIExtractProductParams) MarshalJSON

func (r AIExtractProductParams) MarshalJSON() (data []byte, err error)

func (*AIExtractProductParams) UnmarshalJSON

func (r *AIExtractProductParams) UnmarshalJSON(data []byte) error

type AIExtractProductResponse

type AIExtractProductResponse struct {
	// Whether the given URL is a product detail page
	IsProductPage bool `json:"is_product_page"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata AIExtractProductResponseKeyMetadata `json:"key_metadata"`
	// The detected ecommerce platform, or null if not a product page
	//
	// Any of "amazon", "tiktok_shop", "etsy", "generic".
	Platform AIExtractProductResponsePlatform `json:"platform" api:"nullable"`
	// The extracted product data, or null if not a product page
	Product AIExtractProductResponseProduct `json:"product" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IsProductPage respjson.Field
		KeyMetadata   respjson.Field
		Platform      respjson.Field
		Product       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AIExtractProductResponse) RawJSON

func (r AIExtractProductResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AIExtractProductResponse) UnmarshalJSON

func (r *AIExtractProductResponse) UnmarshalJSON(data []byte) error

type AIExtractProductResponseKeyMetadata

type AIExtractProductResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (AIExtractProductResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*AIExtractProductResponseKeyMetadata) UnmarshalJSON

func (r *AIExtractProductResponseKeyMetadata) UnmarshalJSON(data []byte) error

type AIExtractProductResponsePlatform

type AIExtractProductResponsePlatform string

The detected ecommerce platform, or null if not a product page

const (
	AIExtractProductResponsePlatformAmazon     AIExtractProductResponsePlatform = "amazon"
	AIExtractProductResponsePlatformTiktokShop AIExtractProductResponsePlatform = "tiktok_shop"
	AIExtractProductResponsePlatformEtsy       AIExtractProductResponsePlatform = "etsy"
	AIExtractProductResponsePlatformGeneric    AIExtractProductResponsePlatform = "generic"
)

type AIExtractProductResponseProduct

type AIExtractProductResponseProduct struct {
	// Description of the product
	Description string `json:"description" api:"required"`
	// List of product features
	Features []string `json:"features" api:"required"`
	// URLs to product images on the page (up to 7)
	Images []string `json:"images" api:"required"`
	// Name of the product
	Name string `json:"name" api:"required"`
	// Stock Keeping Unit (product identifier). Null if no identifier is found.
	SKU string `json:"sku" api:"required"`
	// Tags associated with the product
	Tags []string `json:"tags" api:"required"`
	// Target audience for the product (array of strings)
	TargetAudience []string `json:"target_audience" api:"required"`
	// Billing frequency for the product
	//
	// Any of "monthly", "yearly", "one_time", "usage_based".
	BillingFrequency string `json:"billing_frequency" api:"nullable"`
	// Category of the product
	Category string `json:"category" api:"nullable"`
	// Currency code for the price (e.g., USD, EUR)
	Currency string `json:"currency" api:"nullable"`
	// URL to the product image
	ImageURL string `json:"image_url" api:"nullable"`
	// Price of the product
	Price float64 `json:"price" api:"nullable"`
	// Pricing model for the product
	//
	// Any of "per_seat", "flat", "tiered", "freemium", "custom".
	PricingModel string `json:"pricing_model" api:"nullable"`
	// URL to the product page
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description      respjson.Field
		Features         respjson.Field
		Images           respjson.Field
		Name             respjson.Field
		SKU              respjson.Field
		Tags             respjson.Field
		TargetAudience   respjson.Field
		BillingFrequency respjson.Field
		Category         respjson.Field
		Currency         respjson.Field
		ImageURL         respjson.Field
		Price            respjson.Field
		PricingModel     respjson.Field
		URL              respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The extracted product data, or null if not a product page

func (AIExtractProductResponseProduct) RawJSON

Returns the unmodified JSON received from the API

func (*AIExtractProductResponseProduct) UnmarshalJSON

func (r *AIExtractProductResponseProduct) UnmarshalJSON(data []byte) error

type AIExtractProductsParams

type AIExtractProductsParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfByDomain *AIExtractProductsParamsBodyByDomain `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfByDirectURL *AIExtractProductsParamsBodyByDirectURL `json:",inline"`
	// contains filtered or unexported fields
}

func (AIExtractProductsParams) MarshalJSON

func (u AIExtractProductsParams) MarshalJSON() ([]byte, error)

func (*AIExtractProductsParams) UnmarshalJSON

func (r *AIExtractProductsParams) UnmarshalJSON(data []byte) error

type AIExtractProductsParamsBodyByDirectURL

type AIExtractProductsParamsBodyByDirectURL struct {
	// A specific URL to use directly as the starting point for extraction without
	// domain resolution.
	DirectURL string `json:"directUrl" api:"required" format:"uri"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Maximum number of products to extract.
	MaxProducts param.Opt[int64] `json:"maxProducts,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

The property DirectURL is required.

func (AIExtractProductsParamsBodyByDirectURL) MarshalJSON

func (r AIExtractProductsParamsBodyByDirectURL) MarshalJSON() (data []byte, err error)

func (*AIExtractProductsParamsBodyByDirectURL) UnmarshalJSON

func (r *AIExtractProductsParamsBodyByDirectURL) UnmarshalJSON(data []byte) error

type AIExtractProductsParamsBodyByDomain

type AIExtractProductsParamsBodyByDomain struct {
	// The domain name to analyze.
	Domain string `json:"domain" api:"required"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Maximum number of products to extract.
	MaxProducts param.Opt[int64] `json:"maxProducts,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

The property Domain is required.

func (AIExtractProductsParamsBodyByDomain) MarshalJSON

func (r AIExtractProductsParamsBodyByDomain) MarshalJSON() (data []byte, err error)

func (*AIExtractProductsParamsBodyByDomain) UnmarshalJSON

func (r *AIExtractProductsParamsBodyByDomain) UnmarshalJSON(data []byte) error

type AIExtractProductsResponse

type AIExtractProductsResponse struct {
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata AIExtractProductsResponseKeyMetadata `json:"key_metadata"`
	// Array of products extracted from the website
	Products []AIExtractProductsResponseProduct `json:"products"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		KeyMetadata respjson.Field
		Products    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AIExtractProductsResponse) RawJSON

func (r AIExtractProductsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AIExtractProductsResponse) UnmarshalJSON

func (r *AIExtractProductsResponse) UnmarshalJSON(data []byte) error

type AIExtractProductsResponseKeyMetadata

type AIExtractProductsResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (AIExtractProductsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*AIExtractProductsResponseKeyMetadata) UnmarshalJSON

func (r *AIExtractProductsResponseKeyMetadata) UnmarshalJSON(data []byte) error

type AIExtractProductsResponseProduct

type AIExtractProductsResponseProduct struct {
	// Description of the product
	Description string `json:"description" api:"required"`
	// List of product features
	Features []string `json:"features" api:"required"`
	// URLs to product images on the page (up to 7)
	Images []string `json:"images" api:"required"`
	// Name of the product
	Name string `json:"name" api:"required"`
	// Stock Keeping Unit (product identifier). Null if no identifier is found.
	SKU string `json:"sku" api:"required"`
	// Tags associated with the product
	Tags []string `json:"tags" api:"required"`
	// Target audience for the product (array of strings)
	TargetAudience []string `json:"target_audience" api:"required"`
	// Billing frequency for the product
	//
	// Any of "monthly", "yearly", "one_time", "usage_based".
	BillingFrequency string `json:"billing_frequency" api:"nullable"`
	// Category of the product
	Category string `json:"category" api:"nullable"`
	// Currency code for the price (e.g., USD, EUR)
	Currency string `json:"currency" api:"nullable"`
	// URL to the product image
	ImageURL string `json:"image_url" api:"nullable"`
	// Price of the product
	Price float64 `json:"price" api:"nullable"`
	// Pricing model for the product
	//
	// Any of "per_seat", "flat", "tiered", "freemium", "custom".
	PricingModel string `json:"pricing_model" api:"nullable"`
	// URL to the product page
	URL string `json:"url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description      respjson.Field
		Features         respjson.Field
		Images           respjson.Field
		Name             respjson.Field
		SKU              respjson.Field
		Tags             respjson.Field
		TargetAudience   respjson.Field
		BillingFrequency respjson.Field
		Category         respjson.Field
		Currency         respjson.Field
		ImageURL         respjson.Field
		Price            respjson.Field
		PricingModel     respjson.Field
		URL              respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AIExtractProductsResponseProduct) RawJSON

Returns the unmodified JSON received from the API

func (*AIExtractProductsResponseProduct) UnmarshalJSON

func (r *AIExtractProductsResponseProduct) UnmarshalJSON(data []byte) error

type AIService

type AIService struct {
	// contains filtered or unexported fields
}

AIService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAIService method instead.

func NewAIService

func NewAIService(opts ...option.RequestOption) (r AIService)

NewAIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AIService) ExtractProduct

func (r *AIService) ExtractProduct(ctx context.Context, body AIExtractProductParams, opts ...option.RequestOption) (res *AIExtractProductResponse, err error)

Given a single URL, determines if it is a product page and extracts the product information.

func (*AIService) ExtractProducts

func (r *AIService) ExtractProducts(ctx context.Context, body AIExtractProductsParams, opts ...option.RequestOption) (res *AIExtractProductsResponse, err error)

Extract product information from a brand's website. We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more.

type BatchCancelResponse added in v2.6.0

type BatchCancelResponse struct {
	// Batch ID used to retrieve or cancel the job.
	ID string `json:"id" api:"required"`
	// Reserved and used credits.
	Credits BatchCancelResponseCredits `json:"credits" api:"required"`
	// Why the batch failed.
	Error Error `json:"error" api:"required"`
	// Page failures grouped by error code.
	Errors []ErrorCount `json:"errors" api:"required"`
	// Submission counts.
	Input BatchCancelResponseInput `json:"input" api:"required"`
	// How pages are selected.
	//
	// Any of "scrape", "crawl".
	Mode BatchCancelResponseMode `json:"mode" api:"required"`
	// Current processing counts. Use `status` to check completion.
	Progress BatchCancelResponseProgress `json:"progress" api:"required"`
	// Download links available when the batch finishes. GET /batch/{batch_id}/results
	// serves the same records as paginated JSON.
	Results BatchCancelResponseResults `json:"results" api:"required"`
	// Current state. `completed`, `cancelled`, and `failed` are final.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status BatchCancelResponseStatus `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags   []string                  `json:"tags" api:"required"`
	Timing BatchCancelResponseTiming `json:"timing" api:"required"`
	// Output format.
	//
	// Any of "markdown", "html".
	Type BatchCancelResponseType `json:"type" api:"required"`
	// API key usage for this request.
	KeyMetadata BatchCancelResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Credits     respjson.Field
		Error       respjson.Field
		Errors      respjson.Field
		Input       respjson.Field
		Mode        respjson.Field
		Progress    respjson.Field
		Results     respjson.Field
		Status      respjson.Field
		Tags        respjson.Field
		Timing      respjson.Field
		Type        respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchCancelResponse) RawJSON added in v2.6.0

func (r BatchCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponse) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponse) UnmarshalJSON(data []byte) error

type BatchCancelResponseCredits added in v2.6.0

type BatchCancelResponseCredits struct {
	// Credits used by successful pages.
	Charged int64 `json:"charged" api:"required"`
	// Credits reserved when the batch was accepted.
	Estimated int64 `json:"estimated" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charged     respjson.Field
		Estimated   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Reserved and used credits.

func (BatchCancelResponseCredits) RawJSON added in v2.6.0

func (r BatchCancelResponseCredits) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseCredits) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseCredits) UnmarshalJSON(data []byte) error

type BatchCancelResponseInput added in v2.6.0

type BatchCancelResponseInput struct {
	// Pages accepted, or the crawl page limit. Credits are reserved for this count.
	Accepted int64 `json:"accepted" api:"required"`
	// Duplicate URL and `itemId` pairs skipped. Always 0 for crawls.
	Duplicates int64 `json:"duplicates" api:"required"`
	// Pages rejected during validation.
	Invalid int64 `json:"invalid" api:"required"`
	// Pages submitted before validation. For a crawl, the page limit.
	Submitted int64 `json:"submitted" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Accepted    respjson.Field
		Duplicates  respjson.Field
		Invalid     respjson.Field
		Submitted   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Submission counts.

func (BatchCancelResponseInput) RawJSON added in v2.6.0

func (r BatchCancelResponseInput) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseInput) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseInput) UnmarshalJSON(data []byte) error

type BatchCancelResponseKeyMetadata added in v2.6.0

type BatchCancelResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API key usage for this request.

func (BatchCancelResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchCancelResponseKeyMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BatchCancelResponseMode added in v2.6.0

type BatchCancelResponseMode string

How pages are selected.

const (
	BatchCancelResponseModeScrape BatchCancelResponseMode = "scrape"
	BatchCancelResponseModeCrawl  BatchCancelResponseMode = "crawl"
)

type BatchCancelResponseProgress added in v2.6.0

type BatchCancelResponseProgress struct {
	// Pages that could not be scraped.
	Failed int64 `json:"failed" api:"required"`
	// Accepted pages not yet attempted. Always 0 once the batch completes; a crawl can
	// finish under its page limit when the site has no more reachable pages.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current processing counts. Use `status` to check completion.

func (BatchCancelResponseProgress) RawJSON added in v2.6.0

func (r BatchCancelResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseProgress) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseProgress) UnmarshalJSON(data []byte) error

type BatchCancelResponseResults added in v2.6.0

type BatchCancelResponseResults struct {
	// When the download URLs expire.
	ExpiresAt string `json:"expires_at" api:"required"`
	// Result files. Order is not guaranteed.
	Files []BatchCancelResponseResultsFile `json:"files" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Files       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Download links available when the batch finishes. GET /batch/{batch_id}/results serves the same records as paginated JSON.

func (BatchCancelResponseResults) RawJSON added in v2.6.0

func (r BatchCancelResponseResults) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseResults) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseResults) UnmarshalJSON(data []byte) error

type BatchCancelResponseResultsFile added in v2.6.0

type BatchCancelResponseResultsFile struct {
	// Compressed file size in bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Results in this file.
	Items int64 `json:"items" api:"required"`
	// Temporary URL for a gzipped NDJSON file.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Items       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchCancelResponseResultsFile) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchCancelResponseResultsFile) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseResultsFile) UnmarshalJSON(data []byte) error

type BatchCancelResponseStatus added in v2.6.0

type BatchCancelResponseStatus string

Current state. `completed`, `cancelled`, and `failed` are final.

const (
	BatchCancelResponseStatusQueued     BatchCancelResponseStatus = "queued"
	BatchCancelResponseStatusRunning    BatchCancelResponseStatus = "running"
	BatchCancelResponseStatusCancelling BatchCancelResponseStatus = "cancelling"
	BatchCancelResponseStatusCompleted  BatchCancelResponseStatus = "completed"
	BatchCancelResponseStatusCancelled  BatchCancelResponseStatus = "cancelled"
	BatchCancelResponseStatusFailed     BatchCancelResponseStatus = "failed"
)

type BatchCancelResponseTiming added in v2.6.0

type BatchCancelResponseTiming struct {
	// When processing finished. Null while active.
	CompletedAt string `json:"completed_at" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null while queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchCancelResponseTiming) RawJSON added in v2.6.0

func (r BatchCancelResponseTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseTiming) UnmarshalJSON added in v2.6.0

func (r *BatchCancelResponseTiming) UnmarshalJSON(data []byte) error

type BatchCancelResponseType added in v2.6.0

type BatchCancelResponseType string

Output format.

const (
	BatchCancelResponseTypeMarkdown BatchCancelResponseType = "markdown"
	BatchCancelResponseTypeHTML     BatchCancelResponseType = "html"
)

type BatchGetResponse added in v2.6.0

type BatchGetResponse struct {
	// Batch ID used to retrieve or cancel the job.
	ID string `json:"id" api:"required"`
	// Reserved and used credits.
	Credits BatchGetResponseCredits `json:"credits" api:"required"`
	// Why the batch failed.
	Error Error `json:"error" api:"required"`
	// Page failures grouped by error code.
	Errors []ErrorCount `json:"errors" api:"required"`
	// Submission counts.
	Input BatchGetResponseInput `json:"input" api:"required"`
	// Rejected URLs, up to 100. These are not charged.
	InvalidURLs []BatchGetResponseInvalidURL `json:"invalid_urls" api:"required"`
	// How pages are selected.
	//
	// Any of "scrape", "crawl".
	Mode BatchGetResponseMode `json:"mode" api:"required"`
	// Current processing counts. Use `status` to check completion.
	Progress BatchGetResponseProgress `json:"progress" api:"required"`
	// Download links available when the batch finishes. GET /batch/{batch_id}/results
	// serves the same records as paginated JSON.
	Results BatchGetResponseResults `json:"results" api:"required"`
	// Current state. `completed`, `cancelled`, and `failed` are final.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status BatchGetResponseStatus `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags   []string               `json:"tags" api:"required"`
	Timing BatchGetResponseTiming `json:"timing" api:"required"`
	// Output format.
	//
	// Any of "markdown", "html".
	Type BatchGetResponseType `json:"type" api:"required"`
	// API key usage for this request.
	KeyMetadata BatchGetResponseKeyMetadata `json:"key_metadata"`
	// Webhook signing secret. Also returned by GET /batch/{batch_id}.
	WebhookSecret string `json:"webhook_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Credits       respjson.Field
		Error         respjson.Field
		Errors        respjson.Field
		Input         respjson.Field
		InvalidURLs   respjson.Field
		Mode          respjson.Field
		Progress      respjson.Field
		Results       respjson.Field
		Status        respjson.Field
		Tags          respjson.Field
		Timing        respjson.Field
		Type          respjson.Field
		KeyMetadata   respjson.Field
		WebhookSecret respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponse) RawJSON added in v2.6.0

func (r BatchGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponse) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponse) UnmarshalJSON(data []byte) error

type BatchGetResponseCredits added in v2.6.0

type BatchGetResponseCredits struct {
	// Credits used by successful pages.
	Charged int64 `json:"charged" api:"required"`
	// Credits reserved when the batch was accepted.
	Estimated int64 `json:"estimated" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charged     respjson.Field
		Estimated   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Reserved and used credits.

func (BatchGetResponseCredits) RawJSON added in v2.6.0

func (r BatchGetResponseCredits) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseCredits) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseCredits) UnmarshalJSON(data []byte) error

type BatchGetResponseInput added in v2.6.0

type BatchGetResponseInput struct {
	// Pages accepted, or the crawl page limit. Credits are reserved for this count.
	Accepted int64 `json:"accepted" api:"required"`
	// Duplicate URL and `itemId` pairs skipped. Always 0 for crawls.
	Duplicates int64 `json:"duplicates" api:"required"`
	// Pages rejected during validation.
	Invalid int64 `json:"invalid" api:"required"`
	// Pages submitted before validation. For a crawl, the page limit.
	Submitted int64 `json:"submitted" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Accepted    respjson.Field
		Duplicates  respjson.Field
		Invalid     respjson.Field
		Submitted   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Submission counts.

func (BatchGetResponseInput) RawJSON added in v2.6.0

func (r BatchGetResponseInput) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseInput) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseInput) UnmarshalJSON(data []byte) error

type BatchGetResponseInvalidURL added in v2.6.0

type BatchGetResponseInvalidURL struct {
	// Why it was rejected.
	Reason string `json:"reason" api:"required"`
	// Rejected URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reason      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseInvalidURL) RawJSON added in v2.6.0

func (r BatchGetResponseInvalidURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseInvalidURL) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseInvalidURL) UnmarshalJSON(data []byte) error

type BatchGetResponseKeyMetadata added in v2.6.0

type BatchGetResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API key usage for this request.

func (BatchGetResponseKeyMetadata) RawJSON added in v2.6.0

func (r BatchGetResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseKeyMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BatchGetResponseMode added in v2.6.0

type BatchGetResponseMode string

How pages are selected.

const (
	BatchGetResponseModeScrape BatchGetResponseMode = "scrape"
	BatchGetResponseModeCrawl  BatchGetResponseMode = "crawl"
)

type BatchGetResponseProgress added in v2.6.0

type BatchGetResponseProgress struct {
	// Pages that could not be scraped.
	Failed int64 `json:"failed" api:"required"`
	// Accepted pages not yet attempted. Always 0 once the batch completes; a crawl can
	// finish under its page limit when the site has no more reachable pages.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current processing counts. Use `status` to check completion.

func (BatchGetResponseProgress) RawJSON added in v2.6.0

func (r BatchGetResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseProgress) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseProgress) UnmarshalJSON(data []byte) error

type BatchGetResponseResults added in v2.6.0

type BatchGetResponseResults struct {
	// When the download URLs expire.
	ExpiresAt string `json:"expires_at" api:"required"`
	// Result files. Order is not guaranteed.
	Files []BatchGetResponseResultsFile `json:"files" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Files       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Download links available when the batch finishes. GET /batch/{batch_id}/results serves the same records as paginated JSON.

func (BatchGetResponseResults) RawJSON added in v2.6.0

func (r BatchGetResponseResults) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseResults) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseResults) UnmarshalJSON(data []byte) error

type BatchGetResponseResultsFile added in v2.6.0

type BatchGetResponseResultsFile struct {
	// Compressed file size in bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Results in this file.
	Items int64 `json:"items" api:"required"`
	// Temporary URL for a gzipped NDJSON file.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Items       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseResultsFile) RawJSON added in v2.6.0

func (r BatchGetResponseResultsFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseResultsFile) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseResultsFile) UnmarshalJSON(data []byte) error

type BatchGetResponseStatus added in v2.6.0

type BatchGetResponseStatus string

Current state. `completed`, `cancelled`, and `failed` are final.

const (
	BatchGetResponseStatusQueued     BatchGetResponseStatus = "queued"
	BatchGetResponseStatusRunning    BatchGetResponseStatus = "running"
	BatchGetResponseStatusCancelling BatchGetResponseStatus = "cancelling"
	BatchGetResponseStatusCompleted  BatchGetResponseStatus = "completed"
	BatchGetResponseStatusCancelled  BatchGetResponseStatus = "cancelled"
	BatchGetResponseStatusFailed     BatchGetResponseStatus = "failed"
)

type BatchGetResponseTiming added in v2.6.0

type BatchGetResponseTiming struct {
	// When processing finished. Null while active.
	CompletedAt string `json:"completed_at" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null while queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseTiming) RawJSON added in v2.6.0

func (r BatchGetResponseTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseTiming) UnmarshalJSON added in v2.6.0

func (r *BatchGetResponseTiming) UnmarshalJSON(data []byte) error

type BatchGetResponseType added in v2.6.0

type BatchGetResponseType string

Output format.

const (
	BatchGetResponseTypeMarkdown BatchGetResponseType = "markdown"
	BatchGetResponseTypeHTML     BatchGetResponseType = "html"
)

type BatchGetResultsParams added in v2.6.0

type BatchGetResultsParams struct {
	// next_cursor from the previous page.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Records per page. Defaults to 25. A page can close early so its payload stays
	// under ~8 MB; rely on next_cursor rather than counting records.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BatchGetResultsParams) URLQuery added in v2.6.0

func (r BatchGetResultsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BatchGetResultsParams's query parameters as `url.Values`.

type BatchGetResultsResponse added in v2.6.0

type BatchGetResultsResponse struct {
	// Result records on this page.
	Data []BatchGetResultsResponseDataUnion `json:"data"`
	// Whether another page is available.
	HasMore bool `json:"has_more"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata BatchGetResultsResponseKeyMetadata `json:"key_metadata"`
	// Cursor for the next page.
	NextCursor string `json:"next_cursor" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		KeyMetadata respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResultsResponse) RawJSON added in v2.6.0

func (r BatchGetResultsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponse) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponse) UnmarshalJSON(data []byte) error

type BatchGetResultsResponseDataError added in v2.6.0

type BatchGetResultsResponseDataError struct {
	// Why the page failed.
	ErrorCode string `json:"error_code" api:"required"`
	// Human-readable failure detail.
	Message string `json:"message" api:"required"`
	// The page could not be scraped.
	Status constant.Error `json:"status" default:"error"`
	// URL as submitted, or as discovered by the crawl.
	URL string `json:"url" api:"required"`
	// Caller-supplied identifier echoed from submission.
	ItemID string `json:"itemId"`
	// Caller-supplied metadata echoed from submission.
	Meta map[string]any `json:"meta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Message     respjson.Field
		Status      respjson.Field
		URL         respjson.Field
		ItemID      respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A page the batch could not fetch.

func (BatchGetResultsResponseDataError) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataError) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponseDataError) UnmarshalJSON(data []byte) error

type BatchGetResultsResponseDataOk added in v2.6.0

type BatchGetResultsResponseDataOk struct {
	// URL the content was read from, after redirects.
	FinalURL string `json:"final_url" api:"required"`
	// HTTP status of the final response, when known.
	HTTPStatus int64 `json:"http_status" api:"required"`
	// Metadata extracted from the scraped page HTML.
	Metadata BatchGetResultsResponseDataOkMetadata `json:"metadata" api:"required"`
	// The page was scraped.
	Status constant.Ok `json:"status" default:"ok"`
	// URL as submitted, or as discovered by the crawl.
	URL string `json:"url" api:"required"`
	// Raw page HTML. Present on html batches.
	HTML string `json:"html"`
	// Caller-supplied identifier echoed from submission.
	ItemID string `json:"itemId"`
	// Page content as Markdown. Present on markdown batches.
	Markdown string `json:"markdown"`
	// Caller-supplied metadata echoed from submission.
	Meta map[string]any `json:"meta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinalURL    respjson.Field
		HTTPStatus  respjson.Field
		Metadata    respjson.Field
		Status      respjson.Field
		URL         respjson.Field
		HTML        respjson.Field
		ItemID      respjson.Field
		Markdown    respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A page the batch fetched successfully.

func (BatchGetResultsResponseDataOk) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOk) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponseDataOk) UnmarshalJSON(data []byte) error

type BatchGetResultsResponseDataOkMetadata added in v2.6.0

type BatchGetResultsResponseDataOkMetadata struct {
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []BatchGetResultsResponseDataOkMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]BatchGetResultsResponseDataOkMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Best title extracted from the page.
	Title string `json:"title"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]BatchGetResultsResponseDataOkMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Title          respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata extracted from the scraped page HTML.

func (BatchGetResultsResponseDataOkMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponseDataOkMetadata) UnmarshalJSON(data []byte) error

type BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion added in v2.6.0

type BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataAlternate added in v2.6.0

type BatchGetResultsResponseDataOkMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResultsResponseDataOkMetadataAlternate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataAlternate) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataOpenGraphUnion added in v2.6.0

type BatchGetResultsResponseDataOkMetadataOpenGraphUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BatchGetResultsResponseDataOkMetadataOpenGraphUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataOpenGraphUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataTwitterUnion added in v2.6.0

type BatchGetResultsResponseDataOkMetadataTwitterUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BatchGetResultsResponseDataOkMetadataTwitterUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataTwitterUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataUnion added in v2.6.0

type BatchGetResultsResponseDataUnion struct {
	// This field is from variant [BatchGetResultsResponseDataOk].
	FinalURL string `json:"final_url"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	HTTPStatus int64 `json:"http_status"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	Metadata BatchGetResultsResponseDataOkMetadata `json:"metadata"`
	// Any of "ok", "error".
	Status string `json:"status"`
	URL    string `json:"url"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	HTML   string `json:"html"`
	ItemID string `json:"itemId"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	Markdown string `json:"markdown"`
	Meta     any    `json:"meta"`
	// This field is from variant [BatchGetResultsResponseDataError].
	ErrorCode string `json:"error_code"`
	// This field is from variant [BatchGetResultsResponseDataError].
	Message string `json:"message"`
	JSON    struct {
		FinalURL   respjson.Field
		HTTPStatus respjson.Field
		Metadata   respjson.Field
		Status     respjson.Field
		URL        respjson.Field
		HTML       respjson.Field
		ItemID     respjson.Field
		Markdown   respjson.Field
		Meta       respjson.Field
		ErrorCode  respjson.Field
		Message    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BatchGetResultsResponseDataUnion contains all possible properties and values from BatchGetResultsResponseDataOk, BatchGetResultsResponseDataError.

Use the BatchGetResultsResponseDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BatchGetResultsResponseDataUnion) AsAny added in v2.6.0

func (u BatchGetResultsResponseDataUnion) AsAny() anyBatchGetResultsResponseData

Use the following switch statement to find the correct variant

switch variant := BatchGetResultsResponseDataUnion.AsAny().(type) {
case contextdev.BatchGetResultsResponseDataOk:
case contextdev.BatchGetResultsResponseDataError:
default:
  fmt.Errorf("no variant present")
}

func (BatchGetResultsResponseDataUnion) AsError added in v2.6.0

func (BatchGetResultsResponseDataUnion) AsOk added in v2.6.0

func (BatchGetResultsResponseDataUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataUnion) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponseDataUnion) UnmarshalJSON(data []byte) error

type BatchGetResultsResponseKeyMetadata added in v2.6.0

type BatchGetResultsResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (BatchGetResultsResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseKeyMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchGetResultsResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BatchListParams added in v2.6.0

type BatchListParams struct {
	// Cursor from the previous page.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Batches per page. Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Free-text search term, matched against the batch id, crawl source (start URL or
	// sitemap domain), and tags.
	Q param.Opt[string] `query:"q,omitzero" json:"-"`
	// Comma-separated list of tags to filter by (matches batches having any of them).
	Tags param.Opt[string] `query:"tags,omitzero" json:"-"`
	// `prefix` for as-you-type prefix matching (default), `exact` for full-token
	// matching.
	//
	// Any of "exact", "prefix".
	SearchType BatchListParamsSearchType `query:"search_type,omitzero" json:"-"`
	// Filter by status.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status BatchListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BatchListParams) URLQuery added in v2.6.0

func (r BatchListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BatchListParams's query parameters as `url.Values`.

type BatchListParamsSearchType added in v2.6.0

type BatchListParamsSearchType string

`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.

const (
	BatchListParamsSearchTypeExact  BatchListParamsSearchType = "exact"
	BatchListParamsSearchTypePrefix BatchListParamsSearchType = "prefix"
)

type BatchListParamsStatus added in v2.6.0

type BatchListParamsStatus string

Filter by status.

const (
	BatchListParamsStatusQueued     BatchListParamsStatus = "queued"
	BatchListParamsStatusRunning    BatchListParamsStatus = "running"
	BatchListParamsStatusCancelling BatchListParamsStatus = "cancelling"
	BatchListParamsStatusCompleted  BatchListParamsStatus = "completed"
	BatchListParamsStatusCancelled  BatchListParamsStatus = "cancelled"
	BatchListParamsStatusFailed     BatchListParamsStatus = "failed"
)

type BatchListResponse added in v2.6.0

type BatchListResponse struct {
	// Batches on this page.
	Data []BatchListResponseData `json:"data"`
	// Whether another page is available.
	HasMore bool `json:"has_more"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata BatchListResponseKeyMetadata `json:"key_metadata"`
	// Cursor for the next page.
	NextCursor string `json:"next_cursor" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		KeyMetadata respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponse) RawJSON added in v2.6.0

func (r BatchListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponse) UnmarshalJSON added in v2.6.0

func (r *BatchListResponse) UnmarshalJSON(data []byte) error

type BatchListResponseData added in v2.6.0

type BatchListResponseData struct {
	// Batch ID used to retrieve or cancel the job.
	ID string `json:"id" api:"required"`
	// Reserved and used credits.
	Credits BatchListResponseDataCredits `json:"credits" api:"required"`
	// Why the batch failed.
	Error Error `json:"error" api:"required"`
	// Page failures grouped by error code.
	Errors []ErrorCount `json:"errors" api:"required"`
	// Submission counts.
	Input BatchListResponseDataInput `json:"input" api:"required"`
	// How pages are selected.
	//
	// Any of "scrape", "crawl".
	Mode string `json:"mode" api:"required"`
	// Current processing counts. Use `status` to check completion.
	Progress BatchListResponseDataProgress `json:"progress" api:"required"`
	// Download links available when the batch finishes. GET /batch/{batch_id}/results
	// serves the same records as paginated JSON.
	Results BatchListResponseDataResults `json:"results" api:"required"`
	// Current state. `completed`, `cancelled`, and `failed` are final.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status string `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags   []string                    `json:"tags" api:"required"`
	Timing BatchListResponseDataTiming `json:"timing" api:"required"`
	// Output format.
	//
	// Any of "markdown", "html".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Credits     respjson.Field
		Error       respjson.Field
		Errors      respjson.Field
		Input       respjson.Field
		Mode        respjson.Field
		Progress    respjson.Field
		Results     respjson.Field
		Status      respjson.Field
		Tags        respjson.Field
		Timing      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An asynchronous web scraping job.

func (BatchListResponseData) RawJSON added in v2.6.0

func (r BatchListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponseData) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseData) UnmarshalJSON(data []byte) error

type BatchListResponseDataCredits added in v2.6.0

type BatchListResponseDataCredits struct {
	// Credits used by successful pages.
	Charged int64 `json:"charged" api:"required"`
	// Credits reserved when the batch was accepted.
	Estimated int64 `json:"estimated" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Charged     respjson.Field
		Estimated   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Reserved and used credits.

func (BatchListResponseDataCredits) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataCredits) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataCredits) UnmarshalJSON(data []byte) error

type BatchListResponseDataInput added in v2.6.0

type BatchListResponseDataInput struct {
	// Pages accepted, or the crawl page limit. Credits are reserved for this count.
	Accepted int64 `json:"accepted" api:"required"`
	// Duplicate URL and `itemId` pairs skipped. Always 0 for crawls.
	Duplicates int64 `json:"duplicates" api:"required"`
	// Pages rejected during validation.
	Invalid int64 `json:"invalid" api:"required"`
	// Pages submitted before validation. For a crawl, the page limit.
	Submitted int64 `json:"submitted" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Accepted    respjson.Field
		Duplicates  respjson.Field
		Invalid     respjson.Field
		Submitted   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Submission counts.

func (BatchListResponseDataInput) RawJSON added in v2.6.0

func (r BatchListResponseDataInput) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponseDataInput) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataInput) UnmarshalJSON(data []byte) error

type BatchListResponseDataProgress added in v2.6.0

type BatchListResponseDataProgress struct {
	// Pages that could not be scraped.
	Failed int64 `json:"failed" api:"required"`
	// Accepted pages not yet attempted. Always 0 once the batch completes; a crawl can
	// finish under its page limit when the site has no more reachable pages.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current processing counts. Use `status` to check completion.

func (BatchListResponseDataProgress) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataProgress) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataProgress) UnmarshalJSON(data []byte) error

type BatchListResponseDataResults added in v2.6.0

type BatchListResponseDataResults struct {
	// When the download URLs expire.
	ExpiresAt string `json:"expires_at" api:"required"`
	// Result files. Order is not guaranteed.
	Files []BatchListResponseDataResultsFile `json:"files" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Files       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Download links available when the batch finishes. GET /batch/{batch_id}/results serves the same records as paginated JSON.

func (BatchListResponseDataResults) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataResults) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataResults) UnmarshalJSON(data []byte) error

type BatchListResponseDataResultsFile added in v2.6.0

type BatchListResponseDataResultsFile struct {
	// Compressed file size in bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Results in this file.
	Items int64 `json:"items" api:"required"`
	// Temporary URL for a gzipped NDJSON file.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Items       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponseDataResultsFile) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataResultsFile) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataResultsFile) UnmarshalJSON(data []byte) error

type BatchListResponseDataTiming added in v2.6.0

type BatchListResponseDataTiming struct {
	// When processing finished. Null while active.
	CompletedAt string `json:"completed_at" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null while queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponseDataTiming) RawJSON added in v2.6.0

func (r BatchListResponseDataTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponseDataTiming) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseDataTiming) UnmarshalJSON(data []byte) error

type BatchListResponseKeyMetadata added in v2.6.0

type BatchListResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (BatchListResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseKeyMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchListResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BatchService added in v2.6.0

type BatchService struct {
	// contains filtered or unexported fields
}

BatchService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBatchService method instead.

func NewBatchService added in v2.6.0

func NewBatchService(opts ...option.RequestOption) (r BatchService)

NewBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BatchService) Cancel added in v2.6.0

func (r *BatchService) Cancel(ctx context.Context, batchID string, opts ...option.RequestOption) (res *BatchCancelResponse, err error)

Stop a batch from starting new pages. In-progress pages finish, and unused credits are refunded.

func (*BatchService) Get added in v2.6.0

func (r *BatchService) Get(ctx context.Context, batchID string, opts ...option.RequestOption) (res *BatchGetResponse, err error)

Check progress and get download links when the batch finishes. Also returns the rejected-URL list and webhook signing secret from submission, so nothing is lost if the submit response was dropped.

func (*BatchService) GetResults added in v2.6.0

func (r *BatchService) GetResults(ctx context.Context, batchID string, query BatchGetResultsParams, opts ...option.RequestOption) (res *BatchGetResultsResponse, err error)

Page through the result records of a finished batch as JSON, in the same order as the downloadable result files. Use this instead of downloading and parsing the NDJSON files yourself.

func (*BatchService) List added in v2.6.0

func (r *BatchService) List(ctx context.Context, query BatchListParams, opts ...option.RequestOption) (res *BatchListResponse, err error)

List your batches from newest to oldest. Filter by status or continue with a cursor.

func (*BatchService) Submit added in v2.6.0

func (r *BatchService) Submit(ctx context.Context, body BatchSubmitParams, opts ...option.RequestOption) (res *BatchSubmitResponse, err error)

Retrieve and normalize a person profile from identifiers.

type BatchSubmitParams added in v2.6.0

type BatchSubmitParams struct {
	// Known identifiers for the person. At least one identifier is required.
	Identifiers BatchSubmitParamsIdentifiers `json:"identifiers,omitzero" api:"required"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (BatchSubmitParams) MarshalJSON added in v2.6.0

func (r BatchSubmitParams) MarshalJSON() (data []byte, err error)

func (*BatchSubmitParams) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitParams) UnmarshalJSON(data []byte) error

type BatchSubmitParamsIdentifiers added in v2.6.0

type BatchSubmitParamsIdentifiers struct {
	// LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/.
	LinkedinURL param.Opt[string] `json:"linkedinUrl,omitzero" format:"uri"`
	// contains filtered or unexported fields
}

Known identifiers for the person. At least one identifier is required.

func (BatchSubmitParamsIdentifiers) MarshalJSON added in v2.6.0

func (r BatchSubmitParamsIdentifiers) MarshalJSON() (data []byte, err error)

func (*BatchSubmitParamsIdentifiers) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitParamsIdentifiers) UnmarshalJSON(data []byte) error

type BatchSubmitResponse added in v2.6.0

type BatchSubmitResponse struct {
	// HTTP status code.
	//
	// Any of 200.
	Code int64 `json:"code" api:"required"`
	// Additional response details.
	Metadata BatchSubmitResponseMetadata `json:"metadata" api:"required"`
	// Retrieved person profile.
	Person BatchSubmitResponsePerson `json:"person" api:"required"`
	// Response status.
	//
	// Any of "ok".
	Status BatchSubmitResponseStatus `json:"status" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata BatchSubmitResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Metadata    respjson.Field
		Person      respjson.Field
		Status      respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponse) RawJSON added in v2.6.0

func (r BatchSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchSubmitResponse) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponse) UnmarshalJSON(data []byte) error

type BatchSubmitResponseKeyMetadata added in v2.6.0

type BatchSubmitResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (BatchSubmitResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseKeyMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BatchSubmitResponseMetadata added in v2.6.0

type BatchSubmitResponseMetadata struct {
	// Identifiers returned for the person.
	Identifiers BatchSubmitResponseMetadataIdentifiers `json:"identifiers" api:"required"`
	// Source categories checked.
	//
	// Any of "linkedin", "cv", "manual", "github", "other".
	SourcesAttempted []string `json:"sourcesAttempted" api:"required"`
	// Source categories with data.
	//
	// Any of "linkedin", "cv", "manual", "github", "other".
	SourcesSucceeded []string `json:"sourcesSucceeded" api:"required"`
	// URLs reviewed for this profile.
	URLsAnalyzed []string `json:"urlsAnalyzed" api:"required" format:"uri"`
	// Personal website URL, when found.
	PersonalWebsiteURL string `json:"personalWebsiteUrl" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Identifiers        respjson.Field
		SourcesAttempted   respjson.Field
		SourcesSucceeded   respjson.Field
		URLsAnalyzed       respjson.Field
		PersonalWebsiteURL respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Additional response details.

func (BatchSubmitResponseMetadata) RawJSON added in v2.6.0

func (r BatchSubmitResponseMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseMetadata) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponseMetadata) UnmarshalJSON(data []byte) error

type BatchSubmitResponseMetadataIdentifiers added in v2.6.0

type BatchSubmitResponseMetadataIdentifiers struct {
	// LinkedIn profile URL.
	LinkedinURL string `json:"linkedinUrl" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LinkedinURL respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Identifiers returned for the person.

func (BatchSubmitResponseMetadataIdentifiers) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseMetadataIdentifiers) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponseMetadataIdentifiers) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePerson added in v2.6.0

type BatchSubmitResponsePerson struct {
	// Education history.
	Education []BatchSubmitResponsePersonEducation `json:"education" api:"required"`
	// Work history.
	Experience []BatchSubmitResponsePersonExperience `json:"experience" api:"required"`
	// Core profile details.
	Profile BatchSubmitResponsePersonProfile `json:"profile" api:"required"`
	// Listed skills.
	Skills []BatchSubmitResponsePersonSkill `json:"skills" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Education   respjson.Field
		Experience  respjson.Field
		Profile     respjson.Field
		Skills      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Retrieved person profile.

func (BatchSubmitResponsePerson) RawJSON added in v2.6.0

func (r BatchSubmitResponsePerson) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePerson) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePerson) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonEducation added in v2.6.0

type BatchSubmitResponsePersonEducation struct {
	// School or institution name.
	Institution BatchSubmitResponsePersonEducationInstitution `json:"institution" api:"required"`
	// Education dates.
	Dates BatchSubmitResponsePersonEducationDates `json:"dates"`
	// Additional education details.
	Description string `json:"description"`
	// Area of study.
	FieldOfStudy string `json:"fieldOfStudy"`
	// Degree, certificate, or credential.
	Qualification string `json:"qualification"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Institution   respjson.Field
		Dates         respjson.Field
		Description   respjson.Field
		FieldOfStudy  respjson.Field
		Qualification respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponsePersonEducation) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonEducation) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonEducation) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonEducationDates added in v2.6.0

type BatchSubmitResponsePersonEducationDates struct {
	// End date, when known.
	EndDate BatchSubmitResponsePersonEducationDatesEndDate `json:"endDate"`
	// Whether the entry is current.
	IsCurrent bool `json:"isCurrent"`
	// Start date, when known.
	StartDate BatchSubmitResponsePersonEducationDatesStartDate `json:"startDate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndDate     respjson.Field
		IsCurrent   respjson.Field
		StartDate   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Education dates.

func (BatchSubmitResponsePersonEducationDates) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonEducationDates) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonEducationDates) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonEducationDatesEndDate added in v2.6.0

type BatchSubmitResponsePersonEducationDatesEndDate struct {
	// Year value.
	Year int64 `json:"year" api:"required"`
	// Day value, when known.
	Day int64 `json:"day"`
	// Month value, when known.
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

End date, when known.

func (BatchSubmitResponsePersonEducationDatesEndDate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonEducationDatesEndDate) UnmarshalJSON added in v2.6.0

type BatchSubmitResponsePersonEducationDatesStartDate added in v2.6.0

type BatchSubmitResponsePersonEducationDatesStartDate struct {
	// Year value.
	Year int64 `json:"year" api:"required"`
	// Day value, when known.
	Day int64 `json:"day"`
	// Month value, when known.
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Start date, when known.

func (BatchSubmitResponsePersonEducationDatesStartDate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonEducationDatesStartDate) UnmarshalJSON added in v2.6.0

type BatchSubmitResponsePersonEducationInstitution added in v2.6.0

type BatchSubmitResponsePersonEducationInstitution struct {
	// Display name.
	Display string `json:"display" api:"required"`
	// Standardized name, when available.
	Normalized string `json:"normalized"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Display     respjson.Field
		Normalized  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

School or institution name.

func (BatchSubmitResponsePersonEducationInstitution) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonEducationInstitution) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonEducationInstitution) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonExperience added in v2.6.0

type BatchSubmitResponsePersonExperience struct {
	// Company or organization name.
	Company BatchSubmitResponsePersonExperienceCompany `json:"company" api:"required"`
	// Role or job title.
	Title string `json:"title" api:"required"`
	// Role dates.
	Dates BatchSubmitResponsePersonExperienceDates `json:"dates"`
	// Role description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Company     respjson.Field
		Title       respjson.Field
		Dates       respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponsePersonExperience) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonExperience) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonExperience) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonExperienceCompany added in v2.6.0

type BatchSubmitResponsePersonExperienceCompany struct {
	// Display name.
	Display string `json:"display" api:"required"`
	// Standardized name, when available.
	Normalized string `json:"normalized"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Display     respjson.Field
		Normalized  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Company or organization name.

func (BatchSubmitResponsePersonExperienceCompany) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonExperienceCompany) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonExperienceCompany) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonExperienceDates added in v2.6.0

type BatchSubmitResponsePersonExperienceDates struct {
	// End date, when known.
	EndDate BatchSubmitResponsePersonExperienceDatesEndDate `json:"endDate"`
	// Whether the entry is current.
	IsCurrent bool `json:"isCurrent"`
	// Start date, when known.
	StartDate BatchSubmitResponsePersonExperienceDatesStartDate `json:"startDate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndDate     respjson.Field
		IsCurrent   respjson.Field
		StartDate   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Role dates.

func (BatchSubmitResponsePersonExperienceDates) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonExperienceDates) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonExperienceDates) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonExperienceDatesEndDate added in v2.6.0

type BatchSubmitResponsePersonExperienceDatesEndDate struct {
	// Year value.
	Year int64 `json:"year" api:"required"`
	// Day value, when known.
	Day int64 `json:"day"`
	// Month value, when known.
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

End date, when known.

func (BatchSubmitResponsePersonExperienceDatesEndDate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonExperienceDatesEndDate) UnmarshalJSON added in v2.6.0

type BatchSubmitResponsePersonExperienceDatesStartDate added in v2.6.0

type BatchSubmitResponsePersonExperienceDatesStartDate struct {
	// Year value.
	Year int64 `json:"year" api:"required"`
	// Day value, when known.
	Day int64 `json:"day"`
	// Month value, when known.
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Start date, when known.

func (BatchSubmitResponsePersonExperienceDatesStartDate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonExperienceDatesStartDate) UnmarshalJSON added in v2.6.0

type BatchSubmitResponsePersonProfile added in v2.6.0

type BatchSubmitResponsePersonProfile struct {
	// Person's full name.
	FullName string `json:"fullName"`
	// Short professional headline.
	Headline string `json:"headline"`
	// Person's listed location.
	Location string `json:"location"`
	// Profile image URL.
	ProfilePictureURL string `json:"profilePictureUrl" format:"uri"`
	// Brief profile summary.
	Summary string `json:"summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FullName          respjson.Field
		Headline          respjson.Field
		Location          respjson.Field
		ProfilePictureURL respjson.Field
		Summary           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Core profile details.

func (BatchSubmitResponsePersonProfile) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonProfile) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonProfile) UnmarshalJSON(data []byte) error

type BatchSubmitResponsePersonSkill added in v2.6.0

type BatchSubmitResponsePersonSkill struct {
	// Skill name.
	Name string `json:"name" api:"required"`
	// Standardized skill name, when available.
	Normalized string `json:"normalized"`
	// Skill proficiency, when available.
	Proficiency string `json:"proficiency"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Normalized  respjson.Field
		Proficiency respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponsePersonSkill) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponsePersonSkill) UnmarshalJSON added in v2.6.0

func (r *BatchSubmitResponsePersonSkill) UnmarshalJSON(data []byte) error

type BatchSubmitResponseStatus added in v2.6.0

type BatchSubmitResponseStatus string

Response status.

const (
	BatchSubmitResponseStatusOk BatchSubmitResponseStatus = "ok"
)

type BrandGetParams

type BrandGetParams struct {

	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by domain. Cannot be combined with name, email, or ticker.
	OfByDomain *BrandGetParamsBodyByDomain `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by company name. Cannot be combined with domain, email, or
	// ticker.
	OfByName *BrandGetParamsBodyByName `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by email address. The domain is extracted from the email.
	// Free and disposable email providers are rejected with 422. Cannot be combined
	// with domain, name, or ticker.
	OfByEmail *BrandGetParamsBodyByEmail `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by stock ticker. Cannot be combined with domain, name, or
	// email.
	OfByTicker *BrandGetParamsBodyByTicker `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by fetching the provided URL directly. Note: if you use
	// this, brand data is fetched only from the provided URL — not from the entire
	// internet — so results are limited to what that single page contains. No domain
	// resolution, database lookup, or cross-source enrichment is performed. Cannot be
	// combined with domain, name, email, or ticker.
	OfByDirectURL *BrandGetParamsBodyByDirectURL `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Identify brand data from a transaction descriptor. Cannot be combined with
	// domain, name, email, or ticker.
	OfByTransaction *BrandGetParamsBodyByTransaction `json:",inline"`
	// contains filtered or unexported fields
}

func (BrandGetParams) MarshalJSON

func (u BrandGetParams) MarshalJSON() ([]byte, error)

func (*BrandGetParams) UnmarshalJSON

func (r *BrandGetParams) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByDirectURL added in v2.1.0

type BrandGetParamsBodyByDirectURL struct {
	// Full http(s) URL to fetch brand data from (e.g.,
	// 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire
	// internet.
	DirectURL string `json:"direct_url" api:"required" format:"uri"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for direct-URL-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_direct_url".
	Type constant.ByDirectURL `json:"type" default:"by_direct_url"`
	// contains filtered or unexported fields
}

Retrieve brand data by fetching the provided URL directly. Note: if you use this, brand data is fetched only from the provided URL — not from the entire internet — so results are limited to what that single page contains. No domain resolution, database lookup, or cross-source enrichment is performed. Cannot be combined with domain, name, email, or ticker.

The properties DirectURL, Type are required.

func (BrandGetParamsBodyByDirectURL) MarshalJSON added in v2.1.0

func (r BrandGetParamsBodyByDirectURL) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByDirectURL) UnmarshalJSON added in v2.1.0

func (r *BrandGetParamsBodyByDirectURL) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByDomain

type BrandGetParamsBodyByDomain struct {
	// Domain name to retrieve brand data for (e.g., 'stripe.com').
	Domain string `json:"domain" api:"required"`
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for domain-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_domain".
	Type constant.ByDomain `json:"type" default:"by_domain"`
	// contains filtered or unexported fields
}

Retrieve brand data by domain. Cannot be combined with name, email, or ticker.

The properties Domain, Type are required.

func (BrandGetParamsBodyByDomain) MarshalJSON

func (r BrandGetParamsBodyByDomain) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByDomain) UnmarshalJSON

func (r *BrandGetParamsBodyByDomain) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByEmail

type BrandGetParamsBodyByEmail struct {
	// Email address to retrieve brand data for (e.g., 'jane@stripe.com').
	Email string `json:"email" api:"required" format:"email"`
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for email-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_email".
	Type constant.ByEmail `json:"type" default:"by_email"`
	// contains filtered or unexported fields
}

Retrieve brand data by email address. The domain is extracted from the email. Free and disposable email providers are rejected with 422. Cannot be combined with domain, name, or ticker.

The properties Email, Type are required.

func (BrandGetParamsBodyByEmail) MarshalJSON

func (r BrandGetParamsBodyByEmail) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByEmail) UnmarshalJSON

func (r *BrandGetParamsBodyByEmail) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByName

type BrandGetParamsBodyByName struct {
	// Company name to retrieve brand data for (e.g., 'Apple Inc').
	Name string `json:"name" api:"required"`
	// Optional country code hint (GL parameter) to specify the country when looking up
	// by company name.
	CountryGl param.Opt[string] `json:"country_gl,omitzero"`
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for name-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_name".
	Type constant.ByName `json:"type" default:"by_name"`
	// contains filtered or unexported fields
}

Retrieve brand data by company name. Cannot be combined with domain, email, or ticker.

The properties Name, Type are required.

func (BrandGetParamsBodyByName) MarshalJSON

func (r BrandGetParamsBodyByName) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByName) UnmarshalJSON

func (r *BrandGetParamsBodyByName) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByTicker

type BrandGetParamsBodyByTicker struct {
	// Stock ticker symbol to retrieve brand data for (e.g., 'AAPL').
	Ticker string `json:"ticker" api:"required"`
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Optional stock exchange for the ticker. Defaults to NASDAQ if not specified.
	TickerExchange param.Opt[string] `json:"ticker_exchange,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for ticker-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_ticker".
	Type constant.ByTicker `json:"type" default:"by_ticker"`
	// contains filtered or unexported fields
}

Retrieve brand data by stock ticker. Cannot be combined with domain, name, or email.

The properties Ticker, Type are required.

func (BrandGetParamsBodyByTicker) MarshalJSON

func (r BrandGetParamsBodyByTicker) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByTicker) UnmarshalJSON

func (r *BrandGetParamsBodyByTicker) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByTransaction

type BrandGetParamsBodyByTransaction struct {
	// Transaction information to identify the brand.
	TransactionInfo string `json:"transaction_info" api:"required"`
	// Optional city name to prioritize when searching for the brand.
	City param.Opt[string] `json:"city,omitzero"`
	// Optional country code hint (GL parameter) to specify the country when
	// identifying a transaction.
	CountryGl param.Opt[string] `json:"country_gl,omitzero"`
	// When set to true, the API performs additional verification to ensure the
	// identified brand matches the transaction with high confidence.
	HighConfidenceOnly param.Opt[bool] `json:"high_confidence_only,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Optional Merchant Category Code (MCC) to help identify the business category or
	// industry.
	Mcc BrandGetParamsBodyByTransactionMccUnion `json:"mcc,omitzero"`
	// Optional phone number from the transaction to help verify brand match.
	Phone BrandGetParamsBodyByTransactionPhoneUnion `json:"phone,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Discriminator for transaction-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_transaction".
	Type constant.ByTransaction `json:"type" default:"by_transaction"`
	// contains filtered or unexported fields
}

Identify brand data from a transaction descriptor. Cannot be combined with domain, name, email, or ticker.

The properties TransactionInfo, Type are required.

func (BrandGetParamsBodyByTransaction) MarshalJSON

func (r BrandGetParamsBodyByTransaction) MarshalJSON() (data []byte, err error)

func (*BrandGetParamsBodyByTransaction) UnmarshalJSON

func (r *BrandGetParamsBodyByTransaction) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByTransactionMccUnion added in v2.5.0

type BrandGetParamsBodyByTransactionMccUnion struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BrandGetParamsBodyByTransactionMccUnion) MarshalJSON added in v2.5.0

func (u BrandGetParamsBodyByTransactionMccUnion) MarshalJSON() ([]byte, error)

func (*BrandGetParamsBodyByTransactionMccUnion) UnmarshalJSON added in v2.5.0

func (u *BrandGetParamsBodyByTransactionMccUnion) UnmarshalJSON(data []byte) error

type BrandGetParamsBodyByTransactionPhoneUnion added in v2.5.0

type BrandGetParamsBodyByTransactionPhoneUnion struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BrandGetParamsBodyByTransactionPhoneUnion) MarshalJSON added in v2.5.0

func (*BrandGetParamsBodyByTransactionPhoneUnion) UnmarshalJSON added in v2.5.0

func (u *BrandGetParamsBodyByTransactionPhoneUnion) UnmarshalJSON(data []byte) error

type BrandGetResponse

type BrandGetResponse struct {
	// Detailed brand information
	Brand BrandGetResponseBrand `json:"brand"`
	// HTTP status code
	Code int64 `json:"code"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata BrandGetResponseKeyMetadata `json:"key_metadata"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Brand       respjson.Field
		Code        respjson.Field
		KeyMetadata respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponse) RawJSON

func (r BrandGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponse) UnmarshalJSON

func (r *BrandGetResponse) UnmarshalJSON(data []byte) error

type BrandGetResponseBrand

type BrandGetResponseBrand struct {
	// Physical address of the brand
	Address BrandGetResponseBrandAddress `json:"address"`
	// An array of backdrop images for the brand
	Backdrops []BrandGetResponseBrandBackdrop `json:"backdrops"`
	// An array of brand colors
	Colors []BrandGetResponseBrandColor `json:"colors"`
	// A brief description of the brand
	Description string `json:"description"`
	// The domain name of the brand
	Domain string `json:"domain"`
	// Company email address
	Email string `json:"email"`
	// Industry classification information for the brand
	Industries BrandGetResponseBrandIndustries `json:"industries"`
	// Indicates whether the brand content is not safe for work (NSFW)
	IsNsfw bool `json:"is_nsfw"`
	// Important website links for the brand
	Links BrandGetResponseBrandLinks `json:"links"`
	// An array of logos associated with the brand
	Logos []BrandGetResponseBrandLogo `json:"logos"`
	// Company phone number
	Phone string `json:"phone"`
	// Language to force for the retrieved brand data.
	//
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	PrimaryLanguage string `json:"primary_language" api:"nullable"`
	// The brand's slogan
	Slogan string `json:"slogan"`
	// An array of social media links for the brand
	Socials []BrandGetResponseBrandSocial `json:"socials"`
	// Stock market information for this brand (will be null if not a publicly traded
	// company)
	Stock BrandGetResponseBrandStock `json:"stock"`
	// The title or name of the brand
	Title string `json:"title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address         respjson.Field
		Backdrops       respjson.Field
		Colors          respjson.Field
		Description     respjson.Field
		Domain          respjson.Field
		Email           respjson.Field
		Industries      respjson.Field
		IsNsfw          respjson.Field
		Links           respjson.Field
		Logos           respjson.Field
		Phone           respjson.Field
		PrimaryLanguage respjson.Field
		Slogan          respjson.Field
		Socials         respjson.Field
		Stock           respjson.Field
		Title           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed brand information

func (BrandGetResponseBrand) RawJSON

func (r BrandGetResponseBrand) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrand) UnmarshalJSON

func (r *BrandGetResponseBrand) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandAddress

type BrandGetResponseBrandAddress struct {
	// City name
	City string `json:"city"`
	// Country name
	Country string `json:"country"`
	// Country code
	CountryCode string `json:"country_code"`
	// Postal or ZIP code
	PostalCode string `json:"postal_code"`
	// State or province code
	StateCode string `json:"state_code"`
	// State or province name
	StateProvince string `json:"state_province"`
	// Street address
	Street string `json:"street"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City          respjson.Field
		Country       respjson.Field
		CountryCode   respjson.Field
		PostalCode    respjson.Field
		StateCode     respjson.Field
		StateProvince respjson.Field
		Street        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Physical address of the brand

func (BrandGetResponseBrandAddress) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandAddress) UnmarshalJSON

func (r *BrandGetResponseBrandAddress) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandBackdrop

type BrandGetResponseBrandBackdrop struct {
	// Array of colors in the backdrop image
	Colors []BrandGetResponseBrandBackdropColor `json:"colors"`
	// Resolution of the backdrop image
	Resolution BrandGetResponseBrandBackdropResolution `json:"resolution"`
	// URL of the backdrop image
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Resolution  respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandBackdrop) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdrop) UnmarshalJSON

func (r *BrandGetResponseBrandBackdrop) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandBackdropColor

type BrandGetResponseBrandBackdropColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandBackdropColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdropColor) UnmarshalJSON

func (r *BrandGetResponseBrandBackdropColor) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandBackdropResolution

type BrandGetResponseBrandBackdropResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the backdrop image

func (BrandGetResponseBrandBackdropResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdropResolution) UnmarshalJSON

func (r *BrandGetResponseBrandBackdropResolution) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandColor

type BrandGetResponseBrandColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandColor) RawJSON

func (r BrandGetResponseBrandColor) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandColor) UnmarshalJSON

func (r *BrandGetResponseBrandColor) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandIndustries

type BrandGetResponseBrandIndustries struct {
	// Easy Industry Classification - array of industry and subindustry pairs
	Eic []BrandGetResponseBrandIndustriesEic `json:"eic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Eic         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Industry classification information for the brand

func (BrandGetResponseBrandIndustries) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandIndustries) UnmarshalJSON

func (r *BrandGetResponseBrandIndustries) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandIndustriesEic

type BrandGetResponseBrandIndustriesEic struct {
	// Industry classification enum
	//
	// Any of "Aerospace & Defense", "Technology", "Finance", "Healthcare", "Retail &
	// E-commerce", "Entertainment", "Education", "Government & Nonprofit", "Industrial
	// & Energy", "Automotive & Transportation", "Lifestyle & Leisure", "Luxury &
	// Fashion", "News & Media", "Sports", "Real Estate & PropTech", "Legal &
	// Compliance", "Telecommunications", "Agriculture & Food", "Professional Services
	// & Agencies", "Chemicals & Materials", "Logistics & Supply Chain", "Hospitality &
	// Tourism", "Construction & Built Environment", "Consumer Packaged Goods (CPG)".
	Industry string `json:"industry" api:"required"`
	// Subindustry classification enum
	//
	// Any of "Defense Systems & Military Hardware", "Aerospace Manufacturing",
	// "Avionics & Navigation Technology", "Subsea & Naval Defense Systems", "Space &
	// Satellite Technology", "Defense IT & Systems Integration", "Software (B2B)",
	// "Software (B2C)", "Cloud Infrastructure & DevOps", "Cybersecurity", "Artificial
	// Intelligence & Machine Learning", "Data Infrastructure & Analytics", "Hardware &
	// Semiconductors", "Fintech Infrastructure", "eCommerce & Marketplace Platforms",
	// "Developer Tools & APIs", "Web3 & Blockchain", "XR & Spatial Computing",
	// "Banking & Lending", "Investment Management & WealthTech", "Insurance &
	// InsurTech", "Payments & Money Movement", "Accounting, Tax & Financial Planning
	// Tools", "Capital Markets & Trading Platforms", "Financial Infrastructure &
	// APIs", "Credit Scoring & Risk Management", "Cryptocurrency & Digital Assets",
	// "BNPL & Alternative Financing", "Healthcare Providers & Services",
	// "Pharmaceuticals & Drug Development", "Medical Devices & Diagnostics",
	// "Biotechnology & Genomics", "Digital Health & Telemedicine", "Health Insurance &
	// Benefits Tech", "Clinical Trials & Research Platforms", "Mental Health &
	// Wellness", "Healthcare IT & EHR Systems", "Consumer Health & Wellness Products",
	// "Online Marketplaces", "Direct-to-Consumer (DTC) Brands", "Retail Tech &
	// Point-of-Sale Systems", "Omnichannel & In-Store Retail", "E-commerce Enablement
	// & Infrastructure", "Subscription & Membership Commerce", "Social Commerce &
	// Influencer Platforms", "Fashion & Apparel Retail", "Food, Beverage & Grocery
	// E-commerce", "Streaming Platforms (Video, Music, Audio)", "Gaming & Interactive
	// Entertainment", "Creator Economy & Influencer Platforms", "Film, TV & Production
	// Studios", "Events, Venues & Live Entertainment", "Virtual Worlds & Metaverse
	// Experiences", "K-12 Education Platforms & Tools", "Higher Education & University
	// Tech", "Online Learning & MOOCs", "Test Prep & Certification", "Corporate
	// Training & Upskilling", "Tutoring & Supplemental Learning", "Education
	// Management Systems (LMS/SIS)", "Language Learning", "Creator-Led & Cohort-Based
	// Courses", "Special Education & Accessibility Tools", "Government Technology &
	// Digital Services", "Civic Engagement & Policy Platforms", "International
	// Development & Humanitarian Aid", "Philanthropy & Grantmaking", "Nonprofit
	// Operations & Fundraising Tools", "Public Health & Social Services", "Education &
	// Youth Development Programs", "Environmental & Climate Action Organizations",
	// "Legal Aid & Social Justice Advocacy", "Municipal & Infrastructure Services",
	// "Manufacturing & Industrial Automation", "Energy Production (Oil, Gas,
	// Nuclear)", "Renewable Energy & Cleantech", "Utilities & Grid Infrastructure",
	// "Industrial IoT & Monitoring Systems", "Construction & Heavy Equipment", "Mining
	// & Natural Resources", "Environmental Engineering & Sustainability", "Energy
	// Storage & Battery Technology", "Automotive OEMs & Vehicle Manufacturing",
	// "Electric Vehicles (EVs) & Charging Infrastructure", "Mobility-as-a-Service
	// (MaaS)", "Fleet Management", "Public Transit & Urban Mobility", "Autonomous
	// Vehicles & ADAS", "Aftermarket Parts & Services", "Telematics & Vehicle
	// Connectivity", "Aviation & Aerospace Transport", "Maritime Shipping", "Fitness &
	// Wellness", "Beauty & Personal Care", "Home & Living", "Dating & Relationships",
	// "Hobbies, Crafts & DIY", "Outdoor & Recreational Gear", "Events, Experiences &
	// Ticketing Platforms", "Designer & Luxury Apparel", "Accessories, Jewelry &
	// Watches", "Footwear & Leather Goods", "Beauty, Fragrance & Skincare", "Fashion
	// Marketplaces & Retail Platforms", "Sustainable & Ethical Fashion", "Resale,
	// Vintage & Circular Fashion", "Fashion Tech & Virtual Try-Ons", "Streetwear &
	// Emerging Luxury", "Couture & Made-to-Measure", "News Publishing & Journalism",
	// "Advertising, Adtech & Media Buying", "Digital Media & Content Platforms",
	// "Broadcasting (TV & Radio)", "Podcasting & Audio Media", "News Aggregators &
	// Curation Tools", "Independent & Creator-Led Media", "Newsletters &
	// Substack-Style Platforms", "Political & Investigative Media", "Trade & Niche
	// Publications", "Media Monitoring & Analytics", "Professional Teams & Leagues",
	// "Sports Media & Broadcasting", "Sports Betting & Fantasy Sports", "Fitness &
	// Athletic Training Platforms", "Sportswear & Equipment", "Esports & Competitive
	// Gaming", "Sports Venues & Event Management", "Athlete Management & Talent
	// Agencies", "Sports Tech & Performance Analytics", "Youth, Amateur & Collegiate
	// Sports", "Real Estate Marketplaces", "Property Management Software", "Rental
	// Platforms", "Mortgage & Lending Tech", "Real Estate Investment Platforms", "Law
	// Firms & Legal Services", "Legal Tech & Automation", "Regulatory Compliance",
	// "E-Discovery & Litigation Tools", "Contract Management", "Governance, Risk &
	// Compliance (GRC)", "IP & Trademark Management", "Legal Research & Intelligence",
	// "Compliance Training & Certification", "Whistleblower & Ethics Reporting",
	// "Mobile & Wireless Networks (3G/4G/5G)", "Broadband & Fiber Internet",
	// "Satellite & Space-Based Communications", "Network Equipment & Infrastructure",
	// "Telecom Billing & OSS/BSS Systems", "VoIP & Unified Communications", "Internet
	// Service Providers (ISPs)", "Edge Computing & Network Virtualization", "IoT
	// Connectivity Platforms", "Precision Agriculture & AgTech", "Crop & Livestock
	// Production", "Food & Beverage Manufacturing & Processing", "Food Distribution",
	// "Restaurants & Food Service", "Agricultural Inputs & Equipment", "Sustainable &
	// Regenerative Agriculture", "Seafood & Aquaculture", "Management Consulting",
	// "Marketing & Advertising Agencies", "Design, Branding & Creative Studios", "IT
	// Services & Managed Services", "Staffing, Recruiting & Talent", "Accounting & Tax
	// Firms", "Public Relations & Communications", "Business Process Outsourcing
	// (BPO)", "Professional Training & Coaching", "Specialty Chemicals", "Commodity &
	// Petrochemicals", "Polymers, Plastics & Rubber", "Coatings, Adhesives &
	// Sealants", "Industrial Gases", "Advanced Materials & Composites", "Battery
	// Materials & Energy Storage", "Electronic Materials & Semiconductor Chemicals",
	// "Agrochemicals & Fertilizers", "Freight & Transportation Tech", "Last-Mile
	// Delivery", "Warehouse Automation", "Supply Chain Visibility Platforms",
	// "Logistics Marketplaces", "Shipping & Freight Forwarding", "Cold Chain
	// Logistics", "Reverse Logistics & Returns", "Cross-Border Trade Tech",
	// "Transportation Management Systems (TMS)", "Hotels & Accommodation", "Vacation
	// Rentals & Short-Term Stays", "Restaurant Tech & Management", "Travel Booking
	// Platforms", "Tourism Experiences & Activities", "Cruise Lines & Marine Tourism",
	// "Hospitality Management Systems", "Event & Venue Management", "Corporate Travel
	// Management", "Travel Insurance & Protection", "Construction Management
	// Software", "BIM/CAD & Design Tools", "Construction Marketplaces", "Equipment
	// Rental & Management", "Building Materials & Procurement", "Construction
	// Workforce Management", "Project Estimation & Bidding", "Modular & Prefab
	// Construction", "Construction Safety & Compliance", "Smart Building Technology",
	// "Food & Beverage CPG", "Home & Personal Care CPG", "CPG Analytics & Insights",
	// "Direct-to-Consumer CPG Brands", "CPG Supply Chain & Distribution", "Private
	// Label Manufacturing", "CPG Retail Intelligence", "Sustainable CPG & Packaging",
	// "Beauty & Cosmetics CPG", "Health & Wellness CPG".
	Subindustry string `json:"subindustry" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Industry    respjson.Field
		Subindustry respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandIndustriesEic) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandIndustriesEic) UnmarshalJSON

func (r *BrandGetResponseBrandIndustriesEic) UnmarshalJSON(data []byte) error
type BrandGetResponseBrandLinks struct {
	// URL to the brand's blog or news page
	Blog string `json:"blog" api:"nullable"`
	// URL to the brand's careers or job opportunities page
	Careers string `json:"careers" api:"nullable"`
	// URL to the brand's contact or contact us page
	Contact string `json:"contact" api:"nullable"`
	// URL to the brand's pricing or plans page
	Pricing string `json:"pricing" api:"nullable"`
	// URL to the brand's privacy policy page
	Privacy string `json:"privacy" api:"nullable"`
	// URL to the brand's terms of service or terms and conditions page
	Terms string `json:"terms" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Blog        respjson.Field
		Careers     respjson.Field
		Contact     respjson.Field
		Pricing     respjson.Field
		Privacy     respjson.Field
		Terms       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Important website links for the brand

func (BrandGetResponseBrandLinks) RawJSON

func (r BrandGetResponseBrandLinks) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLinks) UnmarshalJSON

func (r *BrandGetResponseBrandLinks) UnmarshalJSON(data []byte) error
type BrandGetResponseBrandLogo struct {
	// Array of colors in the logo
	Colors []BrandGetResponseBrandLogoColor `json:"colors"`
	// Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
	// best for dark mode, 'has_opaque_background' = can be used for either as image
	// has its own background
	//
	// Any of "light", "dark", "has_opaque_background".
	Mode string `json:"mode"`
	// Resolution of the logo image
	Resolution BrandGetResponseBrandLogoResolution `json:"resolution"`
	// Type of the logo based on resolution (e.g., 'icon', 'logo')
	//
	// Any of "icon", "logo".
	Type string `json:"type"`
	// CDN hosted url of the logo (ready for display)
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Mode        respjson.Field
		Resolution  respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandLogo) RawJSON

func (r BrandGetResponseBrandLogo) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogo) UnmarshalJSON

func (r *BrandGetResponseBrandLogo) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandLogoColor

type BrandGetResponseBrandLogoColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandLogoColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogoColor) UnmarshalJSON

func (r *BrandGetResponseBrandLogoColor) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandLogoResolution

type BrandGetResponseBrandLogoResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the logo image

func (BrandGetResponseBrandLogoResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogoResolution) UnmarshalJSON

func (r *BrandGetResponseBrandLogoResolution) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandSocial

type BrandGetResponseBrandSocial struct {
	// Type of social media platform
	//
	// Any of "x", "facebook", "instagram", "linkedin", "youtube", "pinterest",
	// "tiktok", "dribbble", "github", "behance", "snapchat", "whatsapp", "telegram",
	// "line", "discord", "twitch", "vimeo", "imdb", "tumblr", "flickr", "giphy",
	// "medium", "spotify", "soundcloud", "tripadvisor", "yelp", "producthunt",
	// "reddit", "crunchbase", "appstore", "playstore".
	Type string `json:"type"`
	// URL of the social media page
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandSocial) RawJSON

func (r BrandGetResponseBrandSocial) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandSocial) UnmarshalJSON

func (r *BrandGetResponseBrandSocial) UnmarshalJSON(data []byte) error

type BrandGetResponseBrandStock

type BrandGetResponseBrandStock struct {
	// Stock exchange name
	Exchange string `json:"exchange"`
	// Stock ticker symbol
	Ticker string `json:"ticker"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Exchange    respjson.Field
		Ticker      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Stock market information for this brand (will be null if not a publicly traded company)

func (BrandGetResponseBrandStock) RawJSON

func (r BrandGetResponseBrandStock) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandStock) UnmarshalJSON

func (r *BrandGetResponseBrandStock) UnmarshalJSON(data []byte) error

type BrandGetResponseKeyMetadata

type BrandGetResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (BrandGetResponseKeyMetadata) RawJSON

func (r BrandGetResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseKeyMetadata) UnmarshalJSON

func (r *BrandGetResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedParams

type BrandGetSimplifiedParams struct {
	// Domain name to retrieve simplified brand data for
	Domain string `query:"domain" api:"required" json:"-"`
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Optional theme preference used when selecting brand assets.
	//
	// Any of "light", "dark".
	Theme BrandGetSimplifiedParamsTheme `query:"theme,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BrandGetSimplifiedParams) URLQuery

func (r BrandGetSimplifiedParams) URLQuery() (v url.Values, err error)

URLQuery serializes BrandGetSimplifiedParams's query parameters as `url.Values`.

type BrandGetSimplifiedParamsTheme added in v2.5.0

type BrandGetSimplifiedParamsTheme string

Optional theme preference used when selecting brand assets.

const (
	BrandGetSimplifiedParamsThemeLight BrandGetSimplifiedParamsTheme = "light"
	BrandGetSimplifiedParamsThemeDark  BrandGetSimplifiedParamsTheme = "dark"
)

type BrandGetSimplifiedResponse

type BrandGetSimplifiedResponse struct {
	// Simplified brand information
	Brand BrandGetSimplifiedResponseBrand `json:"brand"`
	// HTTP status code of the response
	Code int64 `json:"code"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata BrandGetSimplifiedResponseKeyMetadata `json:"key_metadata"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Brand       respjson.Field
		Code        respjson.Field
		KeyMetadata respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponse) RawJSON

func (r BrandGetSimplifiedResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponse) UnmarshalJSON

func (r *BrandGetSimplifiedResponse) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrand

type BrandGetSimplifiedResponseBrand struct {
	// An array of backdrop images for the brand
	Backdrops []BrandGetSimplifiedResponseBrandBackdrop `json:"backdrops"`
	// An array of brand colors
	Colors []BrandGetSimplifiedResponseBrandColor `json:"colors"`
	// The domain name of the brand
	Domain string `json:"domain"`
	// An array of logos associated with the brand
	Logos []BrandGetSimplifiedResponseBrandLogo `json:"logos"`
	// The title or name of the brand
	Title string `json:"title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Backdrops   respjson.Field
		Colors      respjson.Field
		Domain      respjson.Field
		Logos       respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Simplified brand information

func (BrandGetSimplifiedResponseBrand) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrand) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrand) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrandBackdrop

type BrandGetSimplifiedResponseBrandBackdrop struct {
	// Array of colors in the backdrop image
	Colors []BrandGetSimplifiedResponseBrandBackdropColor `json:"colors"`
	// Resolution of the backdrop image
	Resolution BrandGetSimplifiedResponseBrandBackdropResolution `json:"resolution"`
	// URL of the backdrop image
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Resolution  respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponseBrandBackdrop) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandBackdrop) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandBackdrop) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrandBackdropColor

type BrandGetSimplifiedResponseBrandBackdropColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponseBrandBackdropColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandBackdropColor) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandBackdropColor) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrandBackdropResolution

type BrandGetSimplifiedResponseBrandBackdropResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the backdrop image

func (BrandGetSimplifiedResponseBrandBackdropResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandBackdropResolution) UnmarshalJSON

type BrandGetSimplifiedResponseBrandColor

type BrandGetSimplifiedResponseBrandColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponseBrandColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandColor) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandColor) UnmarshalJSON(data []byte) error
type BrandGetSimplifiedResponseBrandLogo struct {
	// Array of colors in the logo
	Colors []BrandGetSimplifiedResponseBrandLogoColor `json:"colors"`
	// Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
	// best for dark mode, 'has_opaque_background' = can be used for either as image
	// has its own background
	//
	// Any of "light", "dark", "has_opaque_background".
	Mode string `json:"mode"`
	// Resolution of the logo image
	Resolution BrandGetSimplifiedResponseBrandLogoResolution `json:"resolution"`
	// Type of the logo based on resolution (e.g., 'icon', 'logo')
	//
	// Any of "icon", "logo".
	Type string `json:"type"`
	// CDN hosted url of the logo (ready for display)
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Mode        respjson.Field
		Resolution  respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponseBrandLogo) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandLogo) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandLogo) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrandLogoColor

type BrandGetSimplifiedResponseBrandLogoColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetSimplifiedResponseBrandLogoColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandLogoColor) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandLogoColor) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseBrandLogoResolution

type BrandGetSimplifiedResponseBrandLogoResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the logo image

func (BrandGetSimplifiedResponseBrandLogoResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseBrandLogoResolution) UnmarshalJSON

func (r *BrandGetSimplifiedResponseBrandLogoResolution) UnmarshalJSON(data []byte) error

type BrandGetSimplifiedResponseKeyMetadata

type BrandGetSimplifiedResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (BrandGetSimplifiedResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetSimplifiedResponseKeyMetadata) UnmarshalJSON

func (r *BrandGetSimplifiedResponseKeyMetadata) UnmarshalJSON(data []byte) error

type BrandService

type BrandService struct {
	// contains filtered or unexported fields
}

BrandService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBrandService method instead.

func NewBrandService

func NewBrandService(opts ...option.RequestOption) (r BrandService)

NewBrandService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BrandService) Get

func (r *BrandService) Get(ctx context.Context, body BrandGetParams, opts ...option.RequestOption) (res *BrandGetResponse, err error)

Retrieve logos, backdrops, colors, industry, description, and more. Provide exactly one lookup identifier in the request body: a domain, company name, email address, stock ticker, transaction descriptor, or direct URL. Note: `by_direct_url` fetches brand data only from the provided URL — not from the entire internet.

func (*BrandService) GetSimplified

Returns a simplified version of brand data containing only essential information: domain, title, colors, logos, and backdrops. Optimized for faster responses and reduced data transfer.

type Client

type Client struct {
	Parse    ParseService
	Web      WebService
	AI       AIService
	Brand    BrandService
	Industry IndustryService
	Utility  UtilityService
	// Monitor pages, sitemaps, and extracted website data for exact or semantic
	// changes. Webhook payloads are documented by the
	// MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload
	// schemas.
	Monitors MonitorService
	Batch    BatchService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the context.dev API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (CONTEXT_DEV_API_KEY, CONTEXT_DEV_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type Error

type Error struct {
	// Batch error code.
	Code string `json:"code" api:"required"`
	// Batch error message.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Why the batch failed.

func (Error) RawJSON added in v2.6.0

func (r Error) RawJSON() string

Returns the unmodified JSON received from the API

func (*Error) UnmarshalJSON added in v2.6.0

func (r *Error) UnmarshalJSON(data []byte) error

type ErrorCount added in v2.6.0

type ErrorCount struct {
	// Error code for these failures.
	Code string `json:"code" api:"required"`
	// Pages that failed with this code.
	Count int64 `json:"count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Page failures sharing one error code.

func (ErrorCount) RawJSON added in v2.6.0

func (r ErrorCount) RawJSON() string

Returns the unmodified JSON received from the API

func (*ErrorCount) UnmarshalJSON added in v2.6.0

func (r *ErrorCount) UnmarshalJSON(data []byte) error

type IndustryGetNaicsParams

type IndustryGetNaicsParams struct {
	// Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
	// it will be used for classification, otherwise, we will search for the brand
	// using the provided title.
	Input string `query:"input" api:"required" json:"-"`
	// Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
	// to 5.
	MaxResults param.Opt[int64] `query:"maxResults,omitzero" json:"-"`
	// Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
	MinResults param.Opt[int64] `query:"minResults,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IndustryGetNaicsParams) URLQuery

func (r IndustryGetNaicsParams) URLQuery() (v url.Values, err error)

URLQuery serializes IndustryGetNaicsParams's query parameters as `url.Values`.

type IndustryGetNaicsResponse

type IndustryGetNaicsResponse struct {
	// Array of NAICS codes and titles.
	Codes []IndustryGetNaicsResponseCode `json:"codes"`
	// Domain found for the brand
	Domain string `json:"domain"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata IndustryGetNaicsResponseKeyMetadata `json:"key_metadata"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// Industry classification type, for naics api it will be `naics`
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Domain      respjson.Field
		KeyMetadata respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetNaicsResponse) RawJSON

func (r IndustryGetNaicsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponse) UnmarshalJSON

func (r *IndustryGetNaicsResponse) UnmarshalJSON(data []byte) error

type IndustryGetNaicsResponseCode

type IndustryGetNaicsResponseCode struct {
	// NAICS code
	Code string `json:"code" api:"required"`
	// Confidence level for how well this NAICS code matches the company description
	//
	// Any of "high", "medium", "low".
	Confidence string `json:"confidence" api:"required"`
	// NAICS title
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Confidence  respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetNaicsResponseCode) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponseCode) UnmarshalJSON

func (r *IndustryGetNaicsResponseCode) UnmarshalJSON(data []byte) error

type IndustryGetNaicsResponseKeyMetadata

type IndustryGetNaicsResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (IndustryGetNaicsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponseKeyMetadata) UnmarshalJSON

func (r *IndustryGetNaicsResponseKeyMetadata) UnmarshalJSON(data []byte) error

type IndustryGetSicParams

type IndustryGetSicParams struct {
	// Brand domain or title to retrieve SIC code for. If a valid domain is provided,
	// it will be used for classification, otherwise, we will search for the brand
	// using the provided title.
	Input string `query:"input" api:"required" json:"-"`
	// Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
	MaxResults param.Opt[int64] `query:"maxResults,omitzero" json:"-"`
	// Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
	MinResults param.Opt[int64] `query:"minResults,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Which SIC dataset to classify against. `original_sic` uses the 1987 Standard
	// Industrial Classification system; `latest_sec` uses the current SIC list as
	// published by the SEC. Defaults to `original_sic`.
	//
	// Any of "original_sic", "latest_sec".
	Type IndustryGetSicParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IndustryGetSicParams) URLQuery

func (r IndustryGetSicParams) URLQuery() (v url.Values, err error)

URLQuery serializes IndustryGetSicParams's query parameters as `url.Values`.

type IndustryGetSicParamsType

type IndustryGetSicParamsType string

Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Industrial Classification system; `latest_sec` uses the current SIC list as published by the SEC. Defaults to `original_sic`.

const (
	IndustryGetSicParamsTypeOriginalSic IndustryGetSicParamsType = "original_sic"
	IndustryGetSicParamsTypeLatestSec   IndustryGetSicParamsType = "latest_sec"
)

type IndustryGetSicResponse

type IndustryGetSicResponse struct {
	// Echoes back which SIC dataset was used to classify the brand.
	//
	// Any of "original_sic", "latest_sec".
	Classification IndustryGetSicResponseClassification `json:"classification"`
	// Array of SIC codes with confidence scores. Extra fields depend on the requested
	// classification: `original_sic` results include `majorGroup` and
	// `majorGroupName`; `latest_sec` results include `office`.
	Codes []IndustryGetSicResponseCode `json:"codes"`
	// Domain found for the brand
	Domain string `json:"domain"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata IndustryGetSicResponseKeyMetadata `json:"key_metadata"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// Industry classification type, for sic api it will be `sic`
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Classification respjson.Field
		Codes          respjson.Field
		Domain         respjson.Field
		KeyMetadata    respjson.Field
		Status         respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetSicResponse) RawJSON

func (r IndustryGetSicResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponse) UnmarshalJSON

func (r *IndustryGetSicResponse) UnmarshalJSON(data []byte) error

type IndustryGetSicResponseClassification

type IndustryGetSicResponseClassification string

Echoes back which SIC dataset was used to classify the brand.

const (
	IndustryGetSicResponseClassificationOriginalSic IndustryGetSicResponseClassification = "original_sic"
	IndustryGetSicResponseClassificationLatestSec   IndustryGetSicResponseClassification = "latest_sec"
)

type IndustryGetSicResponseCode

type IndustryGetSicResponseCode struct {
	// SIC code (4-digit).
	Code string `json:"code" api:"required"`
	// Confidence level for how well this SIC code matches the company description.
	//
	// Any of "high", "medium", "low".
	Confidence string `json:"confidence" api:"required"`
	// SIC industry title.
	Name string `json:"name" api:"required"`
	// 2-digit major group identifier (the leading two digits of the code). Only
	// present when `classification` is `original_sic`.
	MajorGroup string `json:"majorGroup"`
	// Description of the 2-digit major group. Only present when `classification` is
	// `original_sic`.
	MajorGroupName string `json:"majorGroupName"`
	// SEC review office responsible for filings under this code. Only present when
	// `classification` is `latest_sec`.
	Office string `json:"office"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code           respjson.Field
		Confidence     respjson.Field
		Name           respjson.Field
		MajorGroup     respjson.Field
		MajorGroupName respjson.Field
		Office         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetSicResponseCode) RawJSON

func (r IndustryGetSicResponseCode) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponseCode) UnmarshalJSON

func (r *IndustryGetSicResponseCode) UnmarshalJSON(data []byte) error

type IndustryGetSicResponseKeyMetadata

type IndustryGetSicResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (IndustryGetSicResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponseKeyMetadata) UnmarshalJSON

func (r *IndustryGetSicResponseKeyMetadata) UnmarshalJSON(data []byte) error

type IndustryService

type IndustryService struct {
	// contains filtered or unexported fields
}

IndustryService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIndustryService method instead.

func NewIndustryService

func NewIndustryService(opts ...option.RequestOption) (r IndustryService)

NewIndustryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*IndustryService) GetNaics

Classify any brand into 2022 NAICS industry codes from its domain or name.

func (*IndustryService) GetSic

Classify any brand into Standard Industrial Classification (SIC) codes from its domain or name. Choose between the original SIC system (`original_sic`) or the latest SIC list maintained by the SEC (`latest_sec`).

type MonitorDeleteResponse

type MonitorDeleteResponse struct {
	ID      string `json:"id" api:"required"`
	Deleted bool   `json:"deleted" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Deleted     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorDeleteResponse) RawJSON

func (r MonitorDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorDeleteResponse) UnmarshalJSON

func (r *MonitorDeleteResponse) UnmarshalJSON(data []byte) error

type MonitorGetChangeResponse

type MonitorGetChangeResponse struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorGetChangeResponseChangeDetectionType `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time                                   `json:"detected_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode      MonitorGetChangeResponseMode `json:"mode" api:"required"`
	MonitorID string                       `json:"monitor_id" api:"required"`
	// The run that detected this change.
	RunID   string `json:"run_id" api:"required"`
	Summary string `json:"summary" api:"required"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags []string `json:"tags" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    MonitorGetChangeResponseTargetType `json:"target_type" api:"required"`
	Title         string                             `json:"title" api:"required"`
	URL           string                             `json:"url" api:"required" format:"uri"`
	AddedURLCount int64                              `json:"added_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	AddedURLs         []string `json:"added_urls" format:"uri"`
	AfterTextExcerpt  string   `json:"after_text_excerpt"`
	BeforeTextExcerpt string   `json:"before_text_excerpt"`
	Confidence        float64  `json:"confidence"`
	// Text diff between the previous and current page baseline (page targets).
	Diff     string                             `json:"diff"`
	Evidence []MonitorGetChangeResponseEvidence `json:"evidence"`
	// Any of "low", "medium", "high".
	Importance      MonitorGetChangeResponseImportance `json:"importance"`
	MatchedURLCount int64                              `json:"matched_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	MatchedURLs     []string `json:"matched_urls" format:"uri"`
	RemovedURLCount int64    `json:"removed_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	RemovedURLs []string `json:"removed_urls" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		RunID               respjson.Field
		Summary             respjson.Field
		Tags                respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		AddedURLs           respjson.Field
		AfterTextExcerpt    respjson.Field
		BeforeTextExcerpt   respjson.Field
		Confidence          respjson.Field
		Diff                respjson.Field
		Evidence            respjson.Field
		Importance          respjson.Field
		MatchedURLCount     respjson.Field
		MatchedURLs         respjson.Field
		RemovedURLCount     respjson.Field
		RemovedURLs         respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A detected change. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (page: `diff` + excerpts; sitemap: `added_urls`/`removed_urls`; semantic: `confidence`/`importance`/`evidence`/`matched_urls`).

func (MonitorGetChangeResponse) RawJSON

func (r MonitorGetChangeResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetChangeResponse) UnmarshalJSON

func (r *MonitorGetChangeResponse) UnmarshalJSON(data []byte) error

type MonitorGetChangeResponseChangeDetectionType

type MonitorGetChangeResponseChangeDetectionType string
const (
	MonitorGetChangeResponseChangeDetectionTypeExact    MonitorGetChangeResponseChangeDetectionType = "exact"
	MonitorGetChangeResponseChangeDetectionTypeSemantic MonitorGetChangeResponseChangeDetectionType = "semantic"
)

type MonitorGetChangeResponseEvidence

type MonitorGetChangeResponseEvidence struct {
	// Snapshot of the content after the change.
	After string `json:"after" api:"required"`
	// Snapshot of the content before the change.
	Before string `json:"before" api:"required"`
	// Optional URL the evidence relates to. Absent for whole-target diffs.
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetChangeResponseEvidence) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetChangeResponseEvidence) UnmarshalJSON

func (r *MonitorGetChangeResponseEvidence) UnmarshalJSON(data []byte) error

type MonitorGetChangeResponseImportance

type MonitorGetChangeResponseImportance string
const (
	MonitorGetChangeResponseImportanceLow    MonitorGetChangeResponseImportance = "low"
	MonitorGetChangeResponseImportanceMedium MonitorGetChangeResponseImportance = "medium"
	MonitorGetChangeResponseImportanceHigh   MonitorGetChangeResponseImportance = "high"
)

type MonitorGetChangeResponseMode

type MonitorGetChangeResponseMode string

Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.

const (
	MonitorGetChangeResponseModeWeb MonitorGetChangeResponseMode = "web"
)

type MonitorGetChangeResponseTargetType

type MonitorGetChangeResponseTargetType string
const (
	MonitorGetChangeResponseTargetTypePage    MonitorGetChangeResponseTargetType = "page"
	MonitorGetChangeResponseTargetTypeSitemap MonitorGetChangeResponseTargetType = "sitemap"
	MonitorGetChangeResponseTargetTypeExtract MonitorGetChangeResponseTargetType = "extract"
)

type MonitorGetCreditUsageParams added in v2.5.0

type MonitorGetCreditUsageParams struct {
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorGetCreditUsageParams) URLQuery added in v2.5.0

func (r MonitorGetCreditUsageParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorGetCreditUsageParams's query parameters as `url.Values`.

type MonitorGetCreditUsageResponse added in v2.5.0

type MonitorGetCreditUsageResponse struct {
	Data []MonitorGetCreditUsageResponseData `json:"data" api:"required"`
	// Sum of credits across all monitors in the window.
	TotalCredits int64 `json:"total_credits" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		TotalCredits respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetCreditUsageResponse) RawJSON added in v2.5.0

Returns the unmodified JSON received from the API

func (*MonitorGetCreditUsageResponse) UnmarshalJSON added in v2.5.0

func (r *MonitorGetCreditUsageResponse) UnmarshalJSON(data []byte) error

type MonitorGetCreditUsageResponseData added in v2.5.0

type MonitorGetCreditUsageResponseData struct {
	// Credits charged to this monitor over the window.
	Credits   int64  `json:"credits" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	// Monitor name (falls back to the id when the monitor was deleted).
	Name string `json:"name" api:"required"`
	// Number of billed runs over the window.
	Runs int64 `json:"runs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Credits     respjson.Field
		MonitorID   respjson.Field
		Name        respjson.Field
		Runs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetCreditUsageResponseData) RawJSON added in v2.5.0

Returns the unmodified JSON received from the API

func (*MonitorGetCreditUsageResponseData) UnmarshalJSON added in v2.5.0

func (r *MonitorGetCreditUsageResponseData) UnmarshalJSON(data []byte) error

type MonitorGetLimitsResponse added in v2.5.0

type MonitorGetLimitsResponse struct {
	// Maximum number of monitors allowed for the account. Defaults to the plan
	// allowance unless a custom limit is set for the organization.
	MonitorsLimit int64 `json:"monitors_limit" api:"required"`
	// Number of monitors the account currently has.
	MonitorsUsed int64 `json:"monitors_used" api:"required"`
	// The plan tier the limit was resolved from.
	//
	// Any of "free", "starter", "pro", "scale".
	Plan MonitorGetLimitsResponsePlan `json:"plan" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorsLimit respjson.Field
		MonitorsUsed  respjson.Field
		Plan          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetLimitsResponse) RawJSON added in v2.5.0

func (r MonitorGetLimitsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetLimitsResponse) UnmarshalJSON added in v2.5.0

func (r *MonitorGetLimitsResponse) UnmarshalJSON(data []byte) error

type MonitorGetLimitsResponsePlan added in v2.5.0

type MonitorGetLimitsResponsePlan string

The plan tier the limit was resolved from.

const (
	MonitorGetLimitsResponsePlanFree    MonitorGetLimitsResponsePlan = "free"
	MonitorGetLimitsResponsePlanStarter MonitorGetLimitsResponsePlan = "starter"
	MonitorGetLimitsResponsePlanPro     MonitorGetLimitsResponsePlan = "pro"
	MonitorGetLimitsResponsePlanScale   MonitorGetLimitsResponsePlan = "scale"
)

type MonitorGetResponse

type MonitorGetResponse struct {
	ID string `json:"id" api:"required"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorGetResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                              `json:"created_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode MonitorGetResponseMode `json:"mode" api:"required"`
	Name string                 `json:"name" api:"required"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorGetResponseSchedule `json:"schedule" api:"required"`
	// Monitor lifecycle status. `failed` means the most recent run failed (see the
	// monitor's `last_error`); failed monitors keep running on schedule and flip back
	// to `active` on the next successful run. Monitors are auto-`paused` after
	// repeated consecutive failures or insufficient-credit skips; resume by PATCHing
	// status to `active`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorGetResponseStatus `json:"status" api:"required"`
	// Discriminated union describing what the monitor watches.
	Target    MonitorGetResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                     `json:"updated_at" api:"required" format:"date-time"`
	// Current baseline: the last observed value the monitor compares new snapshots
	// against. Its shape follows `target.type` (page/sitemap/extract). Only populated
	// on GET /monitors/{monitor_id}; null until the first baseline run completes (and
	// after a target or change_detection update, which resets the baseline).
	Baseline     MonitorGetResponseBaselineUnion `json:"baseline" api:"nullable"`
	LastChangeAt time.Time                       `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorGetResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                   `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags    []string                  `json:"tags"`
	Webhook MonitorGetResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorGetResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		Schedule        respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).

func (MonitorGetResponse) RawJSON

func (r MonitorGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponse) UnmarshalJSON

func (r *MonitorGetResponse) UnmarshalJSON(data []byte) error

type MonitorGetResponseBaselineExtractBaseline added in v2.1.0

type MonitorGetResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The extracted structured data, matching the monitor's extraction schema (same
	// shape as the /web/extract endpoint's `data`). Refreshed when the monitor
	// re-discovers its page set (at most about once a day); `null` when no extraction
	// has been captured yet.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorGetResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorGetResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error

type MonitorGetResponseBaselinePageBaseline added in v2.1.0

type MonitorGetResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorGetResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorGetResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error

type MonitorGetResponseBaselineSitemapBaseline added in v2.1.0

type MonitorGetResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorGetResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorGetResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error

type MonitorGetResponseBaselineUnion added in v2.1.0

type MonitorGetResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorGetResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorGetResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorGetResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorGetResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorGetResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseBaselineUnion contains all possible properties and values from MonitorGetResponseBaselinePageBaseline, MonitorGetResponseBaselineSitemapBaseline, MonitorGetResponseBaselineExtractBaseline.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorGetResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineUnion) UnmarshalJSON added in v2.1.0

func (r *MonitorGetResponseBaselineUnion) UnmarshalJSON(data []byte) error

type MonitorGetResponseChangeDetectionExact

type MonitorGetResponseChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorGetResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionExact) UnmarshalJSON

func (r *MonitorGetResponseChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorGetResponseChangeDetectionSemantic

type MonitorGetResponseChangeDetectionSemantic struct {
	Type                constant.Semantic `json:"type" default:"semantic"`
	ConfidenceThreshold float64           `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

func (MonitorGetResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionSemantic) UnmarshalJSON

func (r *MonitorGetResponseChangeDetectionSemantic) UnmarshalJSON(data []byte) error

type MonitorGetResponseChangeDetectionUnion

type MonitorGetResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorGetResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseChangeDetectionUnion contains all possible properties and values from MonitorGetResponseChangeDetectionExact, MonitorGetResponseChangeDetectionSemantic.

Use the MonitorGetResponseChangeDetectionUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorGetResponseChangeDetectionUnion) AsAny

func (u MonitorGetResponseChangeDetectionUnion) AsAny() anyMonitorGetResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorGetResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorGetResponseChangeDetectionExact:
case contextdev.MonitorGetResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorGetResponseChangeDetectionUnion) AsExact

func (MonitorGetResponseChangeDetectionUnion) AsSemantic

func (MonitorGetResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionUnion) UnmarshalJSON

func (r *MonitorGetResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorGetResponseLastError

type MonitorGetResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorGetResponseLastError) RawJSON

func (r MonitorGetResponseLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseLastError) UnmarshalJSON

func (r *MonitorGetResponseLastError) UnmarshalJSON(data []byte) error

type MonitorGetResponseMode

type MonitorGetResponseMode string

Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.

const (
	MonitorGetResponseModeWeb MonitorGetResponseMode = "web"
)

type MonitorGetResponseSchedule

type MonitorGetResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorGetResponseSchedule) RawJSON

func (r MonitorGetResponseSchedule) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseSchedule) UnmarshalJSON

func (r *MonitorGetResponseSchedule) UnmarshalJSON(data []byte) error

type MonitorGetResponseStatus

type MonitorGetResponseStatus string

Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.

const (
	MonitorGetResponseStatusActive MonitorGetResponseStatus = "active"
	MonitorGetResponseStatusPaused MonitorGetResponseStatus = "paused"
	MonitorGetResponseStatusFailed MonitorGetResponseStatus = "failed"
)

type MonitorGetResponseTargetExtract

type MonitorGetResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string           `json:"instructions" api:"required"`
	Type         constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL              string `json:"url" api:"required" format:"uri"`
	FollowSubdomains bool   `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

func (MonitorGetResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetExtract) UnmarshalJSON

func (r *MonitorGetResponseTargetExtract) UnmarshalJSON(data []byte) error

type MonitorGetResponseTargetPage

type MonitorGetResponseTargetPage struct {
	Type constant.Page `json:"type" default:"page"`
	URL  string        `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorGetResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPage) UnmarshalJSON

func (r *MonitorGetResponseTargetPage) UnmarshalJSON(data []byte) error

type MonitorGetResponseTargetSitemap

type MonitorGetResponseTargetSitemap struct {
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

func (MonitorGetResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetSitemap) UnmarshalJSON

func (r *MonitorGetResponseTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorGetResponseTargetUnion

type MonitorGetResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type         string `json:"type"`
	URL          string `json:"url"`
	Instructions string `json:"instructions"`
	// This field is from variant [MonitorGetResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseTargetUnion contains all possible properties and values from MonitorGetResponseTargetPage, MonitorGetResponseTargetSitemap, MonitorGetResponseTargetExtract.

Use the MonitorGetResponseTargetUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorGetResponseTargetUnion) AsAny

func (u MonitorGetResponseTargetUnion) AsAny() anyMonitorGetResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorGetResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorGetResponseTargetPage:
case contextdev.MonitorGetResponseTargetSitemap:
case contextdev.MonitorGetResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorGetResponseTargetUnion) AsExtract

func (MonitorGetResponseTargetUnion) AsPage

func (MonitorGetResponseTargetUnion) AsSitemap

func (MonitorGetResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetUnion) UnmarshalJSON

func (r *MonitorGetResponseTargetUnion) UnmarshalJSON(data []byte) error

type MonitorGetResponseWebhook

type MonitorGetResponseWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Signing secret used to verify webhook authenticity. Each delivery includes an
	// `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
	// `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
	// compare and reject stale timestamps to prevent replay. Generated by the API;
	// cannot be set by clients.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetResponseWebhook) RawJSON

func (r MonitorGetResponseWebhook) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseWebhook) UnmarshalJSON

func (r *MonitorGetResponseWebhook) UnmarshalJSON(data []byte) error

type MonitorGetResponseWebhookFailure added in v2.3.0

type MonitorGetResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorGetResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseWebhookFailure) UnmarshalJSON added in v2.3.0

func (r *MonitorGetResponseWebhookFailure) UnmarshalJSON(data []byte) error

type MonitorListAccountChangesParams

type MonitorListAccountChangesParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter changes to a single monitor.
	MonitorID param.Opt[string] `query:"monitor_id,omitzero" json:"-"`
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// Filter by change detection type.
	//
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorListAccountChangesParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"`
	// Filter by target type.
	//
	// Any of "page", "sitemap", "extract".
	TargetType MonitorListAccountChangesParamsTargetType `query:"target_type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListAccountChangesParams) URLQuery

func (r MonitorListAccountChangesParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorListAccountChangesParams's query parameters as `url.Values`.

type MonitorListAccountChangesParamsChangeDetectionType

type MonitorListAccountChangesParamsChangeDetectionType string

Filter by change detection type.

const (
	MonitorListAccountChangesParamsChangeDetectionTypeExact    MonitorListAccountChangesParamsChangeDetectionType = "exact"
	MonitorListAccountChangesParamsChangeDetectionTypeSemantic MonitorListAccountChangesParamsChangeDetectionType = "semantic"
)

type MonitorListAccountChangesParamsTargetType

type MonitorListAccountChangesParamsTargetType string

Filter by target type.

const (
	MonitorListAccountChangesParamsTargetTypePage    MonitorListAccountChangesParamsTargetType = "page"
	MonitorListAccountChangesParamsTargetTypeSitemap MonitorListAccountChangesParamsTargetType = "sitemap"
	MonitorListAccountChangesParamsTargetTypeExtract MonitorListAccountChangesParamsTargetType = "extract"
)

type MonitorListAccountChangesResponse

type MonitorListAccountChangesResponse struct {
	Data       []MonitorListAccountChangesResponseData `json:"data" api:"required"`
	HasMore    bool                                    `json:"has_more" api:"required"`
	NextCursor string                                  `json:"next_cursor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountChangesResponse) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponse) UnmarshalJSON

func (r *MonitorListAccountChangesResponse) UnmarshalJSON(data []byte) error

type MonitorListAccountChangesResponseData

type MonitorListAccountChangesResponseData struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string    `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time `json:"detected_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode      string `json:"mode" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	Summary   string `json:"summary" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    string  `json:"target_type" api:"required"`
	Title         string  `json:"title" api:"required"`
	URL           string  `json:"url" api:"required" format:"uri"`
	AddedURLCount int64   `json:"added_url_count"`
	Confidence    float64 `json:"confidence"`
	// Any of "low", "medium", "high".
	Importance      string `json:"importance"`
	MatchedURLCount int64  `json:"matched_url_count"`
	RemovedURLCount int64  `json:"removed_url_count"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags []string `json:"tags"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		Summary             respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		Confidence          respjson.Field
		Importance          respjson.Field
		MatchedURLCount     respjson.Field
		RemovedURLCount     respjson.Field
		Tags                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A lightweight change summary. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (e.g. sitemap changes include `added_url_count`/`removed_url_count`; semantic changes include `confidence`/`importance`).

func (MonitorListAccountChangesResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponseData) UnmarshalJSON

func (r *MonitorListAccountChangesResponseData) UnmarshalJSON(data []byte) error

type MonitorListAccountRunsParams

type MonitorListAccountRunsParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter runs by lifecycle status.
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status MonitorListAccountRunsParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListAccountRunsParams) URLQuery

func (r MonitorListAccountRunsParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorListAccountRunsParams's query parameters as `url.Values`.

type MonitorListAccountRunsParamsStatus

type MonitorListAccountRunsParamsStatus string

Filter runs by lifecycle status.

const (
	MonitorListAccountRunsParamsStatusQueued    MonitorListAccountRunsParamsStatus = "queued"
	MonitorListAccountRunsParamsStatusRunning   MonitorListAccountRunsParamsStatus = "running"
	MonitorListAccountRunsParamsStatusCompleted MonitorListAccountRunsParamsStatus = "completed"
	MonitorListAccountRunsParamsStatusFailed    MonitorListAccountRunsParamsStatus = "failed"
	MonitorListAccountRunsParamsStatusSkipped   MonitorListAccountRunsParamsStatus = "skipped"
)

type MonitorListAccountRunsResponse

type MonitorListAccountRunsResponse struct {
	Data       []MonitorListAccountRunsResponseData `json:"data" api:"required"`
	HasMore    bool                                 `json:"has_more" api:"required"`
	NextCursor string                               `json:"next_cursor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponse) UnmarshalJSON

func (r *MonitorListAccountRunsResponse) UnmarshalJSON(data []byte) error

type MonitorListAccountRunsResponseData

type MonitorListAccountRunsResponseData struct {
	ID string `json:"id" api:"required"`
	// True when this run established the monitor's initial baseline; baseline runs
	// perform no change detection.
	BaselineCreated bool `json:"baseline_created" api:"required"`
	ChangeDetected  bool `json:"change_detected" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string `json:"change_detection_type" api:"required"`
	// Credits charged for this run (0 for skipped/failed runs).
	CreditsCharged int64  `json:"credits_charged" api:"required"`
	MonitorID      string `json:"monitor_id" api:"required"`
	// The first run after monitor creation is a baseline run.
	//
	// Any of "baseline", "scheduled".
	RunType string `json:"run_type" api:"required"`
	// Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
	// (insufficient credits, monitor paused, or superseded by a concurrent run).
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType  string                                  `json:"target_type" api:"required"`
	ChangeID    string                                  `json:"change_id" api:"nullable"`
	CompletedAt time.Time                               `json:"completed_at" api:"nullable" format:"date-time"`
	Error       MonitorListAccountRunsResponseDataError `json:"error" api:"nullable"`
	// Why a skipped run never executed; null unless status is `skipped`.
	//
	// Any of "insufficient_credits", "monitor_paused", "superseded".
	SkipReason string    `json:"skip_reason" api:"nullable"`
	StartedAt  time.Time `json:"started_at" api:"nullable" format:"date-time"`
	// All webhook deliveries attempted by this run — one per subscribed event that
	// fired. Omitted when no webhook was attempted, including runs created before
	// event selection was added.
	WebhookDeliveries []WebhookDelivery `json:"webhook_deliveries"`
	// Deprecated: use `webhook_deliveries`, which records every attempt now that a run
	// can deliver multiple events. Omitted when no webhook was attempted, including
	// historical runs created before delivery tracking was added.
	//
	// Deprecated: deprecated
	WebhookDelivery WebhookDelivery `json:"webhook_delivery"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		BaselineCreated     respjson.Field
		ChangeDetected      respjson.Field
		ChangeDetectionType respjson.Field
		CreditsCharged      respjson.Field
		MonitorID           respjson.Field
		RunType             respjson.Field
		Status              respjson.Field
		TargetType          respjson.Field
		ChangeID            respjson.Field
		CompletedAt         respjson.Field
		Error               respjson.Field
		SkipReason          respjson.Field
		StartedAt           respjson.Field
		WebhookDeliveries   respjson.Field
		WebhookDelivery     respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponseData) UnmarshalJSON

func (r *MonitorListAccountRunsResponseData) UnmarshalJSON(data []byte) error

type MonitorListAccountRunsResponseDataError

type MonitorListAccountRunsResponseDataError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponseDataError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponseDataError) UnmarshalJSON

func (r *MonitorListAccountRunsResponseDataError) UnmarshalJSON(data []byte) error

type MonitorListChangesParams

type MonitorListChangesParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListChangesParams) URLQuery

func (r MonitorListChangesParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorListChangesParams's query parameters as `url.Values`.

type MonitorListChangesResponse

type MonitorListChangesResponse struct {
	Data       []MonitorListChangesResponseData `json:"data" api:"required"`
	HasMore    bool                             `json:"has_more" api:"required"`
	NextCursor string                           `json:"next_cursor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListChangesResponse) RawJSON

func (r MonitorListChangesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponse) UnmarshalJSON

func (r *MonitorListChangesResponse) UnmarshalJSON(data []byte) error

type MonitorListChangesResponseData

type MonitorListChangesResponseData struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string    `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time `json:"detected_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode      string `json:"mode" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	Summary   string `json:"summary" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    string  `json:"target_type" api:"required"`
	Title         string  `json:"title" api:"required"`
	URL           string  `json:"url" api:"required" format:"uri"`
	AddedURLCount int64   `json:"added_url_count"`
	Confidence    float64 `json:"confidence"`
	// Any of "low", "medium", "high".
	Importance      string `json:"importance"`
	MatchedURLCount int64  `json:"matched_url_count"`
	RemovedURLCount int64  `json:"removed_url_count"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags []string `json:"tags"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		Summary             respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		Confidence          respjson.Field
		Importance          respjson.Field
		MatchedURLCount     respjson.Field
		RemovedURLCount     respjson.Field
		Tags                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A lightweight change summary. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (e.g. sitemap changes include `added_url_count`/`removed_url_count`; semantic changes include `confidence`/`importance`).

func (MonitorListChangesResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponseData) UnmarshalJSON

func (r *MonitorListChangesResponseData) UnmarshalJSON(data []byte) error

type MonitorListParams

type MonitorListParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Free-text search term, matched against the fields named in `search_by`.
	Q param.Opt[string] `query:"q,omitzero" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Comma-separated fields to search with `q`. Defaults to all of them. Note
	// `instructions` only exists on extract monitors.
	//
	// Any of "name", "url", "instructions", "tags".
	SearchBy []string `query:"search_by,omitzero" json:"-"`
	// Comma-separated list of tags to filter by (matches monitors having any of them).
	Tags []string `query:"tags,omitzero" json:"-"`
	// Filter by change detection type.
	//
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorListParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"`
	// `prefix` for as-you-type prefix matching (default), `exact` for full-token
	// matching.
	//
	// Any of "exact", "prefix".
	SearchType MonitorListParamsSearchType `query:"search_type,omitzero" json:"-"`
	// Filter monitors by lifecycle status.
	//
	// Any of "active", "paused", "failed".
	Status MonitorListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by target type.
	//
	// Any of "page", "sitemap", "extract".
	TargetType MonitorListParamsTargetType `query:"target_type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListParams) URLQuery

func (r MonitorListParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorListParams's query parameters as `url.Values`.

type MonitorListParamsChangeDetectionType

type MonitorListParamsChangeDetectionType string

Filter by change detection type.

const (
	MonitorListParamsChangeDetectionTypeExact    MonitorListParamsChangeDetectionType = "exact"
	MonitorListParamsChangeDetectionTypeSemantic MonitorListParamsChangeDetectionType = "semantic"
)

type MonitorListParamsSearchType

type MonitorListParamsSearchType string

`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.

const (
	MonitorListParamsSearchTypeExact  MonitorListParamsSearchType = "exact"
	MonitorListParamsSearchTypePrefix MonitorListParamsSearchType = "prefix"
)

type MonitorListParamsStatus

type MonitorListParamsStatus string

Filter monitors by lifecycle status.

const (
	MonitorListParamsStatusActive MonitorListParamsStatus = "active"
	MonitorListParamsStatusPaused MonitorListParamsStatus = "paused"
	MonitorListParamsStatusFailed MonitorListParamsStatus = "failed"
)

type MonitorListParamsTargetType

type MonitorListParamsTargetType string

Filter by target type.

const (
	MonitorListParamsTargetTypePage    MonitorListParamsTargetType = "page"
	MonitorListParamsTargetTypeSitemap MonitorListParamsTargetType = "sitemap"
	MonitorListParamsTargetTypeExtract MonitorListParamsTargetType = "extract"
)

type MonitorListResponse

type MonitorListResponse struct {
	Data       []MonitorListResponseData `json:"data" api:"required"`
	HasMore    bool                      `json:"has_more" api:"required"`
	NextCursor string                    `json:"next_cursor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListResponse) RawJSON

func (r MonitorListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListResponse) UnmarshalJSON

func (r *MonitorListResponse) UnmarshalJSON(data []byte) error

type MonitorListResponseData

type MonitorListResponseData struct {
	ID string `json:"id" api:"required"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorListResponseDataChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                                   `json:"created_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode string `json:"mode" api:"required"`
	Name string `json:"name" api:"required"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorListResponseDataSchedule `json:"schedule" api:"required"`
	// Monitor lifecycle status. `failed` means the most recent run failed (see the
	// monitor's `last_error`); failed monitors keep running on schedule and flip back
	// to `active` on the next successful run. Monitors are auto-`paused` after
	// repeated consecutive failures or insufficient-credit skips; resume by PATCHing
	// status to `active`.
	//
	// Any of "active", "paused", "failed".
	Status string `json:"status" api:"required"`
	// Discriminated union describing what the monitor watches.
	Target    MonitorListResponseDataTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                          `json:"updated_at" api:"required" format:"date-time"`
	// Current baseline: the last observed value the monitor compares new snapshots
	// against. Its shape follows `target.type` (page/sitemap/extract). Only populated
	// on GET /monitors/{monitor_id}; null until the first baseline run completes (and
	// after a target or change_detection update, which resets the baseline).
	Baseline     MonitorListResponseDataBaselineUnion `json:"baseline" api:"nullable"`
	LastChangeAt time.Time                            `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorListResponseDataLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                        `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags    []string                       `json:"tags"`
	Webhook MonitorListResponseDataWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorListResponseDataWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		Schedule        respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).

func (MonitorListResponseData) RawJSON

func (r MonitorListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListResponseData) UnmarshalJSON

func (r *MonitorListResponseData) UnmarshalJSON(data []byte) error

type MonitorListResponseDataBaselineExtractBaseline added in v2.1.0

type MonitorListResponseDataBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The extracted structured data, matching the monitor's extraction schema (same
	// shape as the /web/extract endpoint's `data`). Refreshed when the monitor
	// re-discovers its page set (at most about once a day); `null` when no extraction
	// has been captured yet.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorListResponseDataBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

type MonitorListResponseDataBaselinePageBaseline added in v2.1.0

type MonitorListResponseDataBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorListResponseDataBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselinePageBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorListResponseDataBaselinePageBaseline) UnmarshalJSON(data []byte) error

type MonitorListResponseDataBaselineSitemapBaseline added in v2.1.0

type MonitorListResponseDataBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorListResponseDataBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

type MonitorListResponseDataBaselineUnion added in v2.1.0

type MonitorListResponseDataBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorListResponseDataBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorListResponseDataBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorListResponseDataBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorListResponseDataBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorListResponseDataBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataBaselineUnion contains all possible properties and values from MonitorListResponseDataBaselinePageBaseline, MonitorListResponseDataBaselineSitemapBaseline, MonitorListResponseDataBaselineExtractBaseline.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorListResponseDataBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineUnion) UnmarshalJSON added in v2.1.0

func (r *MonitorListResponseDataBaselineUnion) UnmarshalJSON(data []byte) error

type MonitorListResponseDataChangeDetectionExact

type MonitorListResponseDataChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorListResponseDataChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionExact) UnmarshalJSON

func (r *MonitorListResponseDataChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorListResponseDataChangeDetectionSemantic

type MonitorListResponseDataChangeDetectionSemantic struct {
	Type                constant.Semantic `json:"type" default:"semantic"`
	ConfidenceThreshold float64           `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

func (MonitorListResponseDataChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionSemantic) UnmarshalJSON

type MonitorListResponseDataChangeDetectionUnion

type MonitorListResponseDataChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorListResponseDataChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataChangeDetectionUnion contains all possible properties and values from MonitorListResponseDataChangeDetectionExact, MonitorListResponseDataChangeDetectionSemantic.

Use the MonitorListResponseDataChangeDetectionUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorListResponseDataChangeDetectionUnion) AsAny

func (u MonitorListResponseDataChangeDetectionUnion) AsAny() anyMonitorListResponseDataChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorListResponseDataChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorListResponseDataChangeDetectionExact:
case contextdev.MonitorListResponseDataChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorListResponseDataChangeDetectionUnion) AsExact

func (MonitorListResponseDataChangeDetectionUnion) AsSemantic

func (MonitorListResponseDataChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionUnion) UnmarshalJSON

func (r *MonitorListResponseDataChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorListResponseDataLastError

type MonitorListResponseDataLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorListResponseDataLastError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataLastError) UnmarshalJSON

func (r *MonitorListResponseDataLastError) UnmarshalJSON(data []byte) error

type MonitorListResponseDataSchedule

type MonitorListResponseDataSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorListResponseDataSchedule) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataSchedule) UnmarshalJSON

func (r *MonitorListResponseDataSchedule) UnmarshalJSON(data []byte) error

type MonitorListResponseDataTargetExtract

type MonitorListResponseDataTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string           `json:"instructions" api:"required"`
	Type         constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL              string `json:"url" api:"required" format:"uri"`
	FollowSubdomains bool   `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

func (MonitorListResponseDataTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetExtract) UnmarshalJSON

func (r *MonitorListResponseDataTargetExtract) UnmarshalJSON(data []byte) error

type MonitorListResponseDataTargetPage

type MonitorListResponseDataTargetPage struct {
	Type constant.Page `json:"type" default:"page"`
	URL  string        `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorListResponseDataTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPage) UnmarshalJSON

func (r *MonitorListResponseDataTargetPage) UnmarshalJSON(data []byte) error

type MonitorListResponseDataTargetSitemap

type MonitorListResponseDataTargetSitemap struct {
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

func (MonitorListResponseDataTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetSitemap) UnmarshalJSON

func (r *MonitorListResponseDataTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorListResponseDataTargetUnion

type MonitorListResponseDataTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type         string `json:"type"`
	URL          string `json:"url"`
	Instructions string `json:"instructions"`
	// This field is from variant [MonitorListResponseDataTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataTargetUnion contains all possible properties and values from MonitorListResponseDataTargetPage, MonitorListResponseDataTargetSitemap, MonitorListResponseDataTargetExtract.

Use the MonitorListResponseDataTargetUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorListResponseDataTargetUnion) AsAny

func (u MonitorListResponseDataTargetUnion) AsAny() anyMonitorListResponseDataTarget

Use the following switch statement to find the correct variant

switch variant := MonitorListResponseDataTargetUnion.AsAny().(type) {
case contextdev.MonitorListResponseDataTargetPage:
case contextdev.MonitorListResponseDataTargetSitemap:
case contextdev.MonitorListResponseDataTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorListResponseDataTargetUnion) AsExtract

func (MonitorListResponseDataTargetUnion) AsPage

func (MonitorListResponseDataTargetUnion) AsSitemap

func (MonitorListResponseDataTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetUnion) UnmarshalJSON

func (r *MonitorListResponseDataTargetUnion) UnmarshalJSON(data []byte) error

type MonitorListResponseDataWebhook

type MonitorListResponseDataWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Signing secret used to verify webhook authenticity. Each delivery includes an
	// `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
	// `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
	// compare and reject stale timestamps to prevent replay. Generated by the API;
	// cannot be set by clients.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListResponseDataWebhook) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataWebhook) UnmarshalJSON

func (r *MonitorListResponseDataWebhook) UnmarshalJSON(data []byte) error

type MonitorListResponseDataWebhookFailure added in v2.3.0

type MonitorListResponseDataWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorListResponseDataWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataWebhookFailure) UnmarshalJSON added in v2.3.0

func (r *MonitorListResponseDataWebhookFailure) UnmarshalJSON(data []byte) error

type MonitorListRunsParams

type MonitorListRunsParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter runs by lifecycle status.
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status MonitorListRunsParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListRunsParams) URLQuery

func (r MonitorListRunsParams) URLQuery() (v url.Values, err error)

URLQuery serializes MonitorListRunsParams's query parameters as `url.Values`.

type MonitorListRunsParamsStatus

type MonitorListRunsParamsStatus string

Filter runs by lifecycle status.

const (
	MonitorListRunsParamsStatusQueued    MonitorListRunsParamsStatus = "queued"
	MonitorListRunsParamsStatusRunning   MonitorListRunsParamsStatus = "running"
	MonitorListRunsParamsStatusCompleted MonitorListRunsParamsStatus = "completed"
	MonitorListRunsParamsStatusFailed    MonitorListRunsParamsStatus = "failed"
	MonitorListRunsParamsStatusSkipped   MonitorListRunsParamsStatus = "skipped"
)

type MonitorListRunsResponse

type MonitorListRunsResponse struct {
	Data       []MonitorListRunsResponseData `json:"data" api:"required"`
	HasMore    bool                          `json:"has_more" api:"required"`
	NextCursor string                        `json:"next_cursor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponse) RawJSON

func (r MonitorListRunsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponse) UnmarshalJSON

func (r *MonitorListRunsResponse) UnmarshalJSON(data []byte) error

type MonitorListRunsResponseData

type MonitorListRunsResponseData struct {
	ID string `json:"id" api:"required"`
	// True when this run established the monitor's initial baseline; baseline runs
	// perform no change detection.
	BaselineCreated bool `json:"baseline_created" api:"required"`
	ChangeDetected  bool `json:"change_detected" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string `json:"change_detection_type" api:"required"`
	// Credits charged for this run (0 for skipped/failed runs).
	CreditsCharged int64  `json:"credits_charged" api:"required"`
	MonitorID      string `json:"monitor_id" api:"required"`
	// The first run after monitor creation is a baseline run.
	//
	// Any of "baseline", "scheduled".
	RunType string `json:"run_type" api:"required"`
	// Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
	// (insufficient credits, monitor paused, or superseded by a concurrent run).
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType  string                           `json:"target_type" api:"required"`
	ChangeID    string                           `json:"change_id" api:"nullable"`
	CompletedAt time.Time                        `json:"completed_at" api:"nullable" format:"date-time"`
	Error       MonitorListRunsResponseDataError `json:"error" api:"nullable"`
	// Why a skipped run never executed; null unless status is `skipped`.
	//
	// Any of "insufficient_credits", "monitor_paused", "superseded".
	SkipReason string    `json:"skip_reason" api:"nullable"`
	StartedAt  time.Time `json:"started_at" api:"nullable" format:"date-time"`
	// All webhook deliveries attempted by this run — one per subscribed event that
	// fired. Omitted when no webhook was attempted, including runs created before
	// event selection was added.
	WebhookDeliveries []WebhookDelivery `json:"webhook_deliveries"`
	// Deprecated: use `webhook_deliveries`, which records every attempt now that a run
	// can deliver multiple events. Omitted when no webhook was attempted, including
	// historical runs created before delivery tracking was added.
	//
	// Deprecated: deprecated
	WebhookDelivery WebhookDelivery `json:"webhook_delivery"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		BaselineCreated     respjson.Field
		ChangeDetected      respjson.Field
		ChangeDetectionType respjson.Field
		CreditsCharged      respjson.Field
		MonitorID           respjson.Field
		RunType             respjson.Field
		Status              respjson.Field
		TargetType          respjson.Field
		ChangeID            respjson.Field
		CompletedAt         respjson.Field
		Error               respjson.Field
		SkipReason          respjson.Field
		StartedAt           respjson.Field
		WebhookDeliveries   respjson.Field
		WebhookDelivery     respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponseData) RawJSON

func (r MonitorListRunsResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponseData) UnmarshalJSON

func (r *MonitorListRunsResponseData) UnmarshalJSON(data []byte) error

type MonitorListRunsResponseDataError

type MonitorListRunsResponseDataError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponseDataError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponseDataError) UnmarshalJSON

func (r *MonitorListRunsResponseDataError) UnmarshalJSON(data []byte) error

type MonitorNewParams

type MonitorNewParams struct {
	Name string `json:"name" api:"required"`
	// Discriminated union describing what the monitor watches.
	Target  MonitorNewParamsTargetUnion `json:"target,omitzero" api:"required"`
	Webhook MonitorNewParamsWebhook     `json:"webhook,omitzero"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorNewParamsChangeDetectionUnion `json:"change_detection,omitzero"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode MonitorNewParamsMode `json:"mode,omitzero"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorNewParamsSchedule `json:"schedule,omitzero"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (MonitorNewParams) MarshalJSON

func (r MonitorNewParams) MarshalJSON() (data []byte, err error)

func (*MonitorNewParams) UnmarshalJSON

func (r *MonitorNewParams) UnmarshalJSON(data []byte) error

type MonitorNewParamsChangeDetectionExact

type MonitorNewParamsChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// contains filtered or unexported fields
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

This struct has a constant value, construct it with NewMonitorNewParamsChangeDetectionExact.

func NewMonitorNewParamsChangeDetectionExact

func NewMonitorNewParamsChangeDetectionExact() MonitorNewParamsChangeDetectionExact

func (MonitorNewParamsChangeDetectionExact) MarshalJSON

func (r MonitorNewParamsChangeDetectionExact) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsChangeDetectionExact) UnmarshalJSON

func (r *MonitorNewParamsChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorNewParamsChangeDetectionSemantic

type MonitorNewParamsChangeDetectionSemantic struct {
	ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"`
	// This field can be elided, and will marshal its zero value as "semantic".
	Type constant.Semantic `json:"type" default:"semantic"`
	// contains filtered or unexported fields
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

The property Type is required.

func (MonitorNewParamsChangeDetectionSemantic) MarshalJSON

func (r MonitorNewParamsChangeDetectionSemantic) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsChangeDetectionSemantic) UnmarshalJSON

func (r *MonitorNewParamsChangeDetectionSemantic) UnmarshalJSON(data []byte) error

type MonitorNewParamsChangeDetectionUnion

type MonitorNewParamsChangeDetectionUnion struct {
	OfExact    *MonitorNewParamsChangeDetectionExact    `json:",omitzero,inline"`
	OfSemantic *MonitorNewParamsChangeDetectionSemantic `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsChangeDetectionUnion) MarshalJSON

func (u MonitorNewParamsChangeDetectionUnion) MarshalJSON() ([]byte, error)

func (*MonitorNewParamsChangeDetectionUnion) UnmarshalJSON

func (u *MonitorNewParamsChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorNewParamsMode

type MonitorNewParamsMode string

Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.

const (
	MonitorNewParamsModeWeb MonitorNewParamsMode = "web"
)

type MonitorNewParamsSchedule

type MonitorNewParamsSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type,omitzero" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

The properties Frequency, Type, Unit are required.

func (MonitorNewParamsSchedule) MarshalJSON

func (r MonitorNewParamsSchedule) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsSchedule) UnmarshalJSON

func (r *MonitorNewParamsSchedule) UnmarshalJSON(data []byte) error

type MonitorNewParamsTargetExtract

type MonitorNewParamsTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Root URL to extract structured data from.
	URL              string          `json:"url" api:"required" format:"uri"`
	FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth param.Opt[int64] `json:"max_depth,omitzero"`
	// Maximum number of pages to track.
	MaxPages param.Opt[int64] `json:"max_pages,omitzero"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema,omitzero"`
	// This field can be elided, and will marshal its zero value as "extract".
	Type constant.Extract `json:"type" default:"extract"`
	// contains filtered or unexported fields
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

The properties Instructions, Type, URL are required.

func (MonitorNewParamsTargetExtract) MarshalJSON

func (r MonitorNewParamsTargetExtract) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsTargetExtract) UnmarshalJSON

func (r *MonitorNewParamsTargetExtract) UnmarshalJSON(data []byte) error

type MonitorNewParamsTargetPage

type MonitorNewParamsTargetPage struct {
	URL string `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace param.Opt[bool] `json:"normalize_whitespace,omitzero"`
	// This field can be elided, and will marshal its zero value as "page".
	Type constant.Page `json:"type" default:"page"`
	// contains filtered or unexported fields
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

The properties Type, URL are required.

func (MonitorNewParamsTargetPage) MarshalJSON

func (r MonitorNewParamsTargetPage) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsTargetPage) UnmarshalJSON

func (r *MonitorNewParamsTargetPage) UnmarshalJSON(data []byte) error

type MonitorNewParamsTargetSitemap

type MonitorNewParamsTargetSitemap struct {
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs param.Opt[int64] `json:"max_urls,omitzero"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude,omitzero"`
	// URL path patterns to include (max 50).
	Include []string `json:"include,omitzero"`
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

The properties Type, URL are required.

func (MonitorNewParamsTargetSitemap) MarshalJSON

func (r MonitorNewParamsTargetSitemap) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsTargetSitemap) UnmarshalJSON

func (r *MonitorNewParamsTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorNewParamsTargetUnion

type MonitorNewParamsTargetUnion struct {
	OfPage    *MonitorNewParamsTargetPage    `json:",omitzero,inline"`
	OfSitemap *MonitorNewParamsTargetSitemap `json:",omitzero,inline"`
	OfExtract *MonitorNewParamsTargetExtract `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsTargetUnion) MarshalJSON

func (u MonitorNewParamsTargetUnion) MarshalJSON() ([]byte, error)

func (*MonitorNewParamsTargetUnion) UnmarshalJSON

func (u *MonitorNewParamsTargetUnion) UnmarshalJSON(data []byte) error

type MonitorNewParamsWebhook

type MonitorNewParamsWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (MonitorNewParamsWebhook) MarshalJSON

func (r MonitorNewParamsWebhook) MarshalJSON() (data []byte, err error)

func (*MonitorNewParamsWebhook) UnmarshalJSON

func (r *MonitorNewParamsWebhook) UnmarshalJSON(data []byte) error

type MonitorNewResponse

type MonitorNewResponse struct {
	ID string `json:"id" api:"required"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorNewResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                              `json:"created_at" api:"required" format:"date-time"`
	// The baseline run queued by this create call, or null if it could not be queued
	// immediately (in which case the baseline runs on the next scheduled tick). Poll
	// GET /monitors/{monitor_id}/runs/{run_id}.
	InitialRunID string `json:"initial_run_id" api:"required"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode MonitorNewResponseMode `json:"mode" api:"required"`
	Name string                 `json:"name" api:"required"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorNewResponseSchedule `json:"schedule" api:"required"`
	// Monitor lifecycle status. `failed` means the most recent run failed (see the
	// monitor's `last_error`); failed monitors keep running on schedule and flip back
	// to `active` on the next successful run. Monitors are auto-`paused` after
	// repeated consecutive failures or insufficient-credit skips; resume by PATCHing
	// status to `active`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorNewResponseStatus `json:"status" api:"required"`
	// Discriminated union describing what the monitor watches.
	Target    MonitorNewResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                     `json:"updated_at" api:"required" format:"date-time"`
	// Current baseline: the last observed value the monitor compares new snapshots
	// against. Its shape follows `target.type` (page/sitemap/extract). Only populated
	// on GET /monitors/{monitor_id}; null until the first baseline run completes (and
	// after a target or change_detection update, which resets the baseline).
	Baseline     MonitorNewResponseBaselineUnion `json:"baseline" api:"nullable"`
	LastChangeAt time.Time                       `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorNewResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                   `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags    []string                  `json:"tags"`
	Webhook MonitorNewResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorNewResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		InitialRunID    respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		Schedule        respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A newly created monitor plus `initial_run_id`, the id of the baseline run queued at creation.

func (MonitorNewResponse) RawJSON

func (r MonitorNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponse) UnmarshalJSON

func (r *MonitorNewResponse) UnmarshalJSON(data []byte) error

type MonitorNewResponseBaselineExtractBaseline added in v2.1.0

type MonitorNewResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The extracted structured data, matching the monitor's extraction schema (same
	// shape as the /web/extract endpoint's `data`). Refreshed when the monitor
	// re-discovers its page set (at most about once a day); `null` when no extraction
	// has been captured yet.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorNewResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorNewResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error

type MonitorNewResponseBaselinePageBaseline added in v2.1.0

type MonitorNewResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorNewResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorNewResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error

type MonitorNewResponseBaselineSitemapBaseline added in v2.1.0

type MonitorNewResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorNewResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorNewResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error

type MonitorNewResponseBaselineUnion added in v2.1.0

type MonitorNewResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorNewResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorNewResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorNewResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorNewResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorNewResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseBaselineUnion contains all possible properties and values from MonitorNewResponseBaselinePageBaseline, MonitorNewResponseBaselineSitemapBaseline, MonitorNewResponseBaselineExtractBaseline.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorNewResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineUnion) UnmarshalJSON added in v2.1.0

func (r *MonitorNewResponseBaselineUnion) UnmarshalJSON(data []byte) error

type MonitorNewResponseChangeDetectionExact

type MonitorNewResponseChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorNewResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionExact) UnmarshalJSON

func (r *MonitorNewResponseChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorNewResponseChangeDetectionSemantic

type MonitorNewResponseChangeDetectionSemantic struct {
	Type                constant.Semantic `json:"type" default:"semantic"`
	ConfidenceThreshold float64           `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

func (MonitorNewResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionSemantic) UnmarshalJSON

func (r *MonitorNewResponseChangeDetectionSemantic) UnmarshalJSON(data []byte) error

type MonitorNewResponseChangeDetectionUnion

type MonitorNewResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorNewResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseChangeDetectionUnion contains all possible properties and values from MonitorNewResponseChangeDetectionExact, MonitorNewResponseChangeDetectionSemantic.

Use the MonitorNewResponseChangeDetectionUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorNewResponseChangeDetectionUnion) AsAny

func (u MonitorNewResponseChangeDetectionUnion) AsAny() anyMonitorNewResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorNewResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorNewResponseChangeDetectionExact:
case contextdev.MonitorNewResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorNewResponseChangeDetectionUnion) AsExact

func (MonitorNewResponseChangeDetectionUnion) AsSemantic

func (MonitorNewResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionUnion) UnmarshalJSON

func (r *MonitorNewResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorNewResponseLastError

type MonitorNewResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorNewResponseLastError) RawJSON

func (r MonitorNewResponseLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseLastError) UnmarshalJSON

func (r *MonitorNewResponseLastError) UnmarshalJSON(data []byte) error

type MonitorNewResponseMode

type MonitorNewResponseMode string

Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.

const (
	MonitorNewResponseModeWeb MonitorNewResponseMode = "web"
)

type MonitorNewResponseSchedule

type MonitorNewResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorNewResponseSchedule) RawJSON

func (r MonitorNewResponseSchedule) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseSchedule) UnmarshalJSON

func (r *MonitorNewResponseSchedule) UnmarshalJSON(data []byte) error

type MonitorNewResponseStatus

type MonitorNewResponseStatus string

Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.

const (
	MonitorNewResponseStatusActive MonitorNewResponseStatus = "active"
	MonitorNewResponseStatusPaused MonitorNewResponseStatus = "paused"
	MonitorNewResponseStatusFailed MonitorNewResponseStatus = "failed"
)

type MonitorNewResponseTargetExtract

type MonitorNewResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string           `json:"instructions" api:"required"`
	Type         constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL              string `json:"url" api:"required" format:"uri"`
	FollowSubdomains bool   `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

func (MonitorNewResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetExtract) UnmarshalJSON

func (r *MonitorNewResponseTargetExtract) UnmarshalJSON(data []byte) error

type MonitorNewResponseTargetPage

type MonitorNewResponseTargetPage struct {
	Type constant.Page `json:"type" default:"page"`
	URL  string        `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorNewResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPage) UnmarshalJSON

func (r *MonitorNewResponseTargetPage) UnmarshalJSON(data []byte) error

type MonitorNewResponseTargetSitemap

type MonitorNewResponseTargetSitemap struct {
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

func (MonitorNewResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetSitemap) UnmarshalJSON

func (r *MonitorNewResponseTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorNewResponseTargetUnion

type MonitorNewResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type         string `json:"type"`
	URL          string `json:"url"`
	Instructions string `json:"instructions"`
	// This field is from variant [MonitorNewResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseTargetUnion contains all possible properties and values from MonitorNewResponseTargetPage, MonitorNewResponseTargetSitemap, MonitorNewResponseTargetExtract.

Use the MonitorNewResponseTargetUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorNewResponseTargetUnion) AsAny

func (u MonitorNewResponseTargetUnion) AsAny() anyMonitorNewResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorNewResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorNewResponseTargetPage:
case contextdev.MonitorNewResponseTargetSitemap:
case contextdev.MonitorNewResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorNewResponseTargetUnion) AsExtract

func (MonitorNewResponseTargetUnion) AsPage

func (MonitorNewResponseTargetUnion) AsSitemap

func (MonitorNewResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetUnion) UnmarshalJSON

func (r *MonitorNewResponseTargetUnion) UnmarshalJSON(data []byte) error

type MonitorNewResponseWebhook

type MonitorNewResponseWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Signing secret used to verify webhook authenticity. Each delivery includes an
	// `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
	// `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
	// compare and reject stale timestamps to prevent replay. Generated by the API;
	// cannot be set by clients.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorNewResponseWebhook) RawJSON

func (r MonitorNewResponseWebhook) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseWebhook) UnmarshalJSON

func (r *MonitorNewResponseWebhook) UnmarshalJSON(data []byte) error

type MonitorNewResponseWebhookFailure added in v2.3.0

type MonitorNewResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorNewResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseWebhookFailure) UnmarshalJSON added in v2.3.0

func (r *MonitorNewResponseWebhookFailure) UnmarshalJSON(data []byte) error

type MonitorRunResponse

type MonitorRunResponse struct {
	MonitorID string `json:"monitor_id" api:"required"`
	Queued    bool   `json:"queued" api:"required"`
	// The queued run. Poll GET /monitors/{monitor_id}/runs or use it to correlate
	// results.
	RunID string `json:"run_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorID   respjson.Field
		Queued      respjson.Field
		RunID       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorRunResponse) RawJSON

func (r MonitorRunResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorRunResponse) UnmarshalJSON

func (r *MonitorRunResponse) UnmarshalJSON(data []byte) error

type MonitorService

type MonitorService struct {
	// contains filtered or unexported fields
}

Monitor pages, sitemaps, and extracted website data for exact or semantic changes. Webhook payloads are documented by the MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload schemas.

MonitorService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorService method instead.

func NewMonitorService

func NewMonitorService(opts ...option.RequestOption) (r MonitorService)

NewMonitorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MonitorService) Delete

func (r *MonitorService) Delete(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)

Delete a monitor

func (*MonitorService) Get

func (r *MonitorService) Get(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorGetResponse, err error)

Get a monitor

func (*MonitorService) GetChange

func (r *MonitorService) GetChange(ctx context.Context, changeID string, opts ...option.RequestOption) (res *MonitorGetChangeResponse, err error)

Get a change

func (*MonitorService) GetCreditUsage added in v2.5.0

Returns credits charged per monitor over an optional [since, until] window, newest spenders first.

func (*MonitorService) GetLimits added in v2.5.0

func (r *MonitorService) GetLimits(ctx context.Context, opts ...option.RequestOption) (res *MonitorGetLimitsResponse, err error)

Returns how many monitors the account has and the maximum it allows.

func (*MonitorService) List

Lists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.

func (*MonitorService) ListAccountChanges

Returns an account-wide feed of detected changes across monitors.

func (*MonitorService) ListAccountRuns

Returns an account-wide feed of monitor runs across all monitors.

func (*MonitorService) ListChanges

func (r *MonitorService) ListChanges(ctx context.Context, monitorID string, query MonitorListChangesParams, opts ...option.RequestOption) (res *MonitorListChangesResponse, err error)

List changes for a monitor

func (*MonitorService) ListRuns

func (r *MonitorService) ListRuns(ctx context.Context, monitorID string, query MonitorListRunsParams, opts ...option.RequestOption) (res *MonitorListRunsResponse, err error)

List monitor runs

func (*MonitorService) New

Creates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.

func (*MonitorService) Run

func (r *MonitorService) Run(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorRunResponse, err error)

Triggers an immediate run of the monitor outside its normal schedule. The run is queued and processed asynchronously.

func (*MonitorService) Update

func (r *MonitorService) Update(ctx context.Context, monitorID string, body MonitorUpdateParams, opts ...option.RequestOption) (res *MonitorUpdateResponse, err error)

Updates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.

type MonitorUpdateParams

type MonitorUpdateParams struct {
	Name param.Opt[string] `json:"name,omitzero"`
	// Set to null to remove the webhook.
	Webhook MonitorUpdateParamsWebhook `json:"webhook,omitzero"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorUpdateParamsChangeDetectionUnion `json:"change_detection,omitzero"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorUpdateParamsSchedule `json:"schedule,omitzero"`
	// Any of "active", "paused".
	Status MonitorUpdateParamsStatus `json:"status,omitzero"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags []string `json:"tags,omitzero"`
	// Discriminated union describing what the monitor watches.
	Target MonitorUpdateParamsTargetUnion `json:"target,omitzero"`
	// contains filtered or unexported fields
}

func (MonitorUpdateParams) MarshalJSON

func (r MonitorUpdateParams) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParams) UnmarshalJSON

func (r *MonitorUpdateParams) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsChangeDetectionExact

type MonitorUpdateParamsChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// contains filtered or unexported fields
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

This struct has a constant value, construct it with NewMonitorUpdateParamsChangeDetectionExact.

func NewMonitorUpdateParamsChangeDetectionExact

func NewMonitorUpdateParamsChangeDetectionExact() MonitorUpdateParamsChangeDetectionExact

func (MonitorUpdateParamsChangeDetectionExact) MarshalJSON

func (r MonitorUpdateParamsChangeDetectionExact) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsChangeDetectionExact) UnmarshalJSON

func (r *MonitorUpdateParamsChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsChangeDetectionSemantic

type MonitorUpdateParamsChangeDetectionSemantic struct {
	ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"`
	// This field can be elided, and will marshal its zero value as "semantic".
	Type constant.Semantic `json:"type" default:"semantic"`
	// contains filtered or unexported fields
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

The property Type is required.

func (MonitorUpdateParamsChangeDetectionSemantic) MarshalJSON

func (r MonitorUpdateParamsChangeDetectionSemantic) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsChangeDetectionSemantic) UnmarshalJSON

func (r *MonitorUpdateParamsChangeDetectionSemantic) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsChangeDetectionUnion

type MonitorUpdateParamsChangeDetectionUnion struct {
	OfExact    *MonitorUpdateParamsChangeDetectionExact    `json:",omitzero,inline"`
	OfSemantic *MonitorUpdateParamsChangeDetectionSemantic `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsChangeDetectionUnion) MarshalJSON

func (u MonitorUpdateParamsChangeDetectionUnion) MarshalJSON() ([]byte, error)

func (*MonitorUpdateParamsChangeDetectionUnion) UnmarshalJSON

func (u *MonitorUpdateParamsChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsSchedule

type MonitorUpdateParamsSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type,omitzero" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

The properties Frequency, Type, Unit are required.

func (MonitorUpdateParamsSchedule) MarshalJSON

func (r MonitorUpdateParamsSchedule) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsSchedule) UnmarshalJSON

func (r *MonitorUpdateParamsSchedule) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsStatus

type MonitorUpdateParamsStatus string
const (
	MonitorUpdateParamsStatusActive MonitorUpdateParamsStatus = "active"
	MonitorUpdateParamsStatusPaused MonitorUpdateParamsStatus = "paused"
)

type MonitorUpdateParamsTargetExtract

type MonitorUpdateParamsTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Root URL to extract structured data from.
	URL              string          `json:"url" api:"required" format:"uri"`
	FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth param.Opt[int64] `json:"max_depth,omitzero"`
	// Maximum number of pages to track.
	MaxPages param.Opt[int64] `json:"max_pages,omitzero"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema,omitzero"`
	// This field can be elided, and will marshal its zero value as "extract".
	Type constant.Extract `json:"type" default:"extract"`
	// contains filtered or unexported fields
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

The properties Instructions, Type, URL are required.

func (MonitorUpdateParamsTargetExtract) MarshalJSON

func (r MonitorUpdateParamsTargetExtract) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsTargetExtract) UnmarshalJSON

func (r *MonitorUpdateParamsTargetExtract) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsTargetPage

type MonitorUpdateParamsTargetPage struct {
	URL string `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace param.Opt[bool] `json:"normalize_whitespace,omitzero"`
	// This field can be elided, and will marshal its zero value as "page".
	Type constant.Page `json:"type" default:"page"`
	// contains filtered or unexported fields
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

The properties Type, URL are required.

func (MonitorUpdateParamsTargetPage) MarshalJSON

func (r MonitorUpdateParamsTargetPage) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsTargetPage) UnmarshalJSON

func (r *MonitorUpdateParamsTargetPage) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsTargetSitemap

type MonitorUpdateParamsTargetSitemap struct {
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs param.Opt[int64] `json:"max_urls,omitzero"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude,omitzero"`
	// URL path patterns to include (max 50).
	Include []string `json:"include,omitzero"`
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

The properties Type, URL are required.

func (MonitorUpdateParamsTargetSitemap) MarshalJSON

func (r MonitorUpdateParamsTargetSitemap) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsTargetSitemap) UnmarshalJSON

func (r *MonitorUpdateParamsTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsTargetUnion

type MonitorUpdateParamsTargetUnion struct {
	OfPage    *MonitorUpdateParamsTargetPage    `json:",omitzero,inline"`
	OfSitemap *MonitorUpdateParamsTargetSitemap `json:",omitzero,inline"`
	OfExtract *MonitorUpdateParamsTargetExtract `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsTargetUnion) MarshalJSON

func (u MonitorUpdateParamsTargetUnion) MarshalJSON() ([]byte, error)

func (*MonitorUpdateParamsTargetUnion) UnmarshalJSON

func (u *MonitorUpdateParamsTargetUnion) UnmarshalJSON(data []byte) error

type MonitorUpdateParamsWebhook

type MonitorUpdateParamsWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events,omitzero"`
	// contains filtered or unexported fields
}

Set to null to remove the webhook.

The property URL is required.

func (MonitorUpdateParamsWebhook) MarshalJSON

func (r MonitorUpdateParamsWebhook) MarshalJSON() (data []byte, err error)

func (*MonitorUpdateParamsWebhook) UnmarshalJSON

func (r *MonitorUpdateParamsWebhook) UnmarshalJSON(data []byte) error

type MonitorUpdateResponse

type MonitorUpdateResponse struct {
	ID string `json:"id" api:"required"`
	// Discriminated union describing how changes are detected.
	ChangeDetection MonitorUpdateResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                                 `json:"created_at" api:"required" format:"date-time"`
	// Top-level monitor category. Always `web` today; the concrete behavior is
	// described by `target` and `change_detection`.
	//
	// Any of "web".
	Mode MonitorUpdateResponseMode `json:"mode" api:"required"`
	Name string                    `json:"name" api:"required"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorUpdateResponseSchedule `json:"schedule" api:"required"`
	// Monitor lifecycle status. `failed` means the most recent run failed (see the
	// monitor's `last_error`); failed monitors keep running on schedule and flip back
	// to `active` on the next successful run. Monitors are auto-`paused` after
	// repeated consecutive failures or insufficient-credit skips; resume by PATCHing
	// status to `active`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorUpdateResponseStatus `json:"status" api:"required"`
	// Discriminated union describing what the monitor watches.
	Target    MonitorUpdateResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                        `json:"updated_at" api:"required" format:"date-time"`
	// Current baseline: the last observed value the monitor compares new snapshots
	// against. Its shape follows `target.type` (page/sitemap/extract). Only populated
	// on GET /monitors/{monitor_id}; null until the first baseline run completes (and
	// after a target or change_detection update, which resets the baseline).
	Baseline     MonitorUpdateResponseBaselineUnion `json:"baseline" api:"nullable"`
	LastChangeAt time.Time                          `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorUpdateResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                      `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// User-defined tags for grouping and filtering monitors and their changes.
	// Duplicates are removed.
	Tags    []string                     `json:"tags"`
	Webhook MonitorUpdateResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorUpdateResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		Schedule        respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).

func (MonitorUpdateResponse) RawJSON

func (r MonitorUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponse) UnmarshalJSON

func (r *MonitorUpdateResponse) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseBaselineExtractBaseline added in v2.1.0

type MonitorUpdateResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The extracted structured data, matching the monitor's extraction schema (same
	// shape as the /web/extract endpoint's `data`). Refreshed when the monitor
	// re-discovers its page set (at most about once a day); `null` when no extraction
	// has been captured yet.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorUpdateResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorUpdateResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseBaselinePageBaseline added in v2.1.0

type MonitorUpdateResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorUpdateResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorUpdateResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseBaselineSitemapBaseline added in v2.1.0

type MonitorUpdateResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorUpdateResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

func (r *MonitorUpdateResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseBaselineUnion added in v2.1.0

type MonitorUpdateResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorUpdateResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorUpdateResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorUpdateResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseBaselineUnion contains all possible properties and values from MonitorUpdateResponseBaselinePageBaseline, MonitorUpdateResponseBaselineSitemapBaseline, MonitorUpdateResponseBaselineExtractBaseline.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorUpdateResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineUnion) UnmarshalJSON added in v2.1.0

func (r *MonitorUpdateResponseBaselineUnion) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseChangeDetectionExact

type MonitorUpdateResponseChangeDetectionExact struct {
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorUpdateResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionExact) UnmarshalJSON

func (r *MonitorUpdateResponseChangeDetectionExact) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseChangeDetectionSemantic

type MonitorUpdateResponseChangeDetectionSemantic struct {
	Type                constant.Semantic `json:"type" default:"semantic"`
	ConfidenceThreshold float64           `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).

func (MonitorUpdateResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionSemantic) UnmarshalJSON

func (r *MonitorUpdateResponseChangeDetectionSemantic) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseChangeDetectionUnion

type MonitorUpdateResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorUpdateResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseChangeDetectionUnion contains all possible properties and values from MonitorUpdateResponseChangeDetectionExact, MonitorUpdateResponseChangeDetectionSemantic.

Use the MonitorUpdateResponseChangeDetectionUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorUpdateResponseChangeDetectionUnion) AsAny

func (u MonitorUpdateResponseChangeDetectionUnion) AsAny() anyMonitorUpdateResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorUpdateResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorUpdateResponseChangeDetectionExact:
case contextdev.MonitorUpdateResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorUpdateResponseChangeDetectionUnion) AsExact

func (MonitorUpdateResponseChangeDetectionUnion) AsSemantic

func (MonitorUpdateResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionUnion) UnmarshalJSON

func (r *MonitorUpdateResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseLastError

type MonitorUpdateResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorUpdateResponseLastError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseLastError) UnmarshalJSON

func (r *MonitorUpdateResponseLastError) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseMode

type MonitorUpdateResponseMode string

Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.

const (
	MonitorUpdateResponseModeWeb MonitorUpdateResponseMode = "web"
)

type MonitorUpdateResponseSchedule

type MonitorUpdateResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorUpdateResponseSchedule) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseSchedule) UnmarshalJSON

func (r *MonitorUpdateResponseSchedule) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseStatus

type MonitorUpdateResponseStatus string

Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.

const (
	MonitorUpdateResponseStatusActive MonitorUpdateResponseStatus = "active"
	MonitorUpdateResponseStatusPaused MonitorUpdateResponseStatus = "paused"
	MonitorUpdateResponseStatusFailed MonitorUpdateResponseStatus = "failed"
)

type MonitorUpdateResponseTargetExtract

type MonitorUpdateResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string           `json:"instructions" api:"required"`
	Type         constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL              string `json:"url" api:"required" format:"uri"`
	FollowSubdomains bool   `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema describing the data you care about. It is used three ways: it guides
	// which pages are selected for tracking, it gives the change judge extra context
	// on which changes matter (alongside `instructions`), and it defines the shape of
	// the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
	// about once a day). It is not a response format for changes: change events and
	// webhook payloads always contain diffs, summaries, and evidence excerpts — never
	// data in this schema's shape. If omitted, a default summary + key-points schema
	// is used.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.

func (MonitorUpdateResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetExtract) UnmarshalJSON

func (r *MonitorUpdateResponseTargetExtract) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseTargetPage

type MonitorUpdateResponseTargetPage struct {
	Type constant.Page `json:"type" default:"page"`
	URL  string        `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorUpdateResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPage) UnmarshalJSON

func (r *MonitorUpdateResponseTargetPage) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseTargetSitemap

type MonitorUpdateResponseTargetSitemap struct {
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.

func (MonitorUpdateResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetSitemap) UnmarshalJSON

func (r *MonitorUpdateResponseTargetSitemap) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseTargetUnion

type MonitorUpdateResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type         string `json:"type"`
	URL          string `json:"url"`
	Instructions string `json:"instructions"`
	// This field is from variant [MonitorUpdateResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseTargetUnion contains all possible properties and values from MonitorUpdateResponseTargetPage, MonitorUpdateResponseTargetSitemap, MonitorUpdateResponseTargetExtract.

Use the MonitorUpdateResponseTargetUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MonitorUpdateResponseTargetUnion) AsAny

func (u MonitorUpdateResponseTargetUnion) AsAny() anyMonitorUpdateResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorUpdateResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorUpdateResponseTargetPage:
case contextdev.MonitorUpdateResponseTargetSitemap:
case contextdev.MonitorUpdateResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorUpdateResponseTargetUnion) AsExtract

func (MonitorUpdateResponseTargetUnion) AsPage

func (MonitorUpdateResponseTargetUnion) AsSitemap

func (MonitorUpdateResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetUnion) UnmarshalJSON

func (r *MonitorUpdateResponseTargetUnion) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseWebhook

type MonitorUpdateResponseWebhook struct {
	// Webhook URL events are delivered to.
	URL string `json:"url" api:"required" format:"uri"`
	// Events delivered to this endpoint. `change.detected` fires only when a run
	// detects a change; `run.completed` fires on every completed run — including runs
	// that detected no change — and embeds the change when one was detected. Defaults
	// to `["change.detected"]` when omitted.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Signing secret used to verify webhook authenticity. Each delivery includes an
	// `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
	// `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
	// compare and reject stale timestamps to prevent replay. Generated by the API;
	// cannot be set by clients.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorUpdateResponseWebhook) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseWebhook) UnmarshalJSON

func (r *MonitorUpdateResponseWebhook) UnmarshalJSON(data []byte) error

type MonitorUpdateResponseWebhookFailure added in v2.3.0

type MonitorUpdateResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorUpdateResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseWebhookFailure) UnmarshalJSON added in v2.3.0

func (r *MonitorUpdateResponseWebhookFailure) UnmarshalJSON(data []byte) error

type ParseHandleParams added in v2.3.0

type ParseHandleParams struct {
	// Optional client identifier used for usage attribution.
	Client param.Opt[string] `query:"client,omitzero" json:"-"`
	// Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv,
	// md, py, rtf, jpg, png, or txt.
	//
	// Any of "txt", "text", "md", "markdown", "html", "htm", "xhtml", "xml", "rss",
	// "atom", "csv", "tsv", "yaml", "yml", "py", "java", "js", "jsx", "mjs", "cjs",
	// "json", "jsonl", "ndjson", "php", "sh", "bash", "zsh", "fish", "rb", "ts",
	// "tsx", "rtf", "srt", "css", "scss", "less", "styl", "sass", "svg", "pdf",
	// "docx", "doc", "xlsx", "xlsm", "xlsb", "xltx", "xltm", "xls", "pptx", "pptm",
	// "ppsx", "ppsm", "potx", "potm", "ppt", "pps", "pot", "jpg", "jpeg", "jpe",
	// "png", "gif", "bmp", "tiff", "tif", "webp", "ppm", "pbm", "pgm", "pnm".
	Extension ParseHandleParamsExtension `query:"extension,omitzero" json:"-"`
	// Include image references in Markdown output
	IncludeImages ParseHandleParamsIncludeImagesUnion `query:"includeImages,omitzero" json:"-"`
	// Preserve hyperlinks in Markdown output
	IncludeLinks ParseHandleParamsIncludeLinksUnion `query:"includeLinks,omitzero" json:"-"`
	// When true for PDF inputs, detect and OCR images embedded in the selected pages,
	// inserting recognized text at each image's position in page reading order while
	// preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range.
	// When false, all OCR is disabled, including the automatic scanned-PDF fallback.
	Ocr ParseHandleParamsOcrUnion `query:"ocr,omitzero" json:"-"`
	// PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
	Pdf ParseHandleParamsPdf `query:"pdf,omitzero" json:"-"`
	// Shorten base64-encoded image data in the Markdown output
	ShortenBase64Images ParseHandleParamsShortenBase64ImagesUnion `query:"shortenBase64Images,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Extract only the main content from HTML-like inputs
	UseMainContentOnly ParseHandleParamsUseMainContentOnlyUnion `query:"useMainContentOnly,omitzero" json:"-"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr ParseHandleParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ParseHandleParams) MarshalMultipart added in v2.3.0

func (r ParseHandleParams) MarshalMultipart() (data []byte, contentType string, err error)

func (ParseHandleParams) URLQuery added in v2.3.0

func (r ParseHandleParams) URLQuery() (v url.Values, err error)

URLQuery serializes ParseHandleParams's query parameters as `url.Values`.

type ParseHandleParamsExtension added in v2.4.0

type ParseHandleParamsExtension string

Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.

const (
	ParseHandleParamsExtensionTxt      ParseHandleParamsExtension = "txt"
	ParseHandleParamsExtensionText     ParseHandleParamsExtension = "text"
	ParseHandleParamsExtensionMd       ParseHandleParamsExtension = "md"
	ParseHandleParamsExtensionMarkdown ParseHandleParamsExtension = "markdown"
	ParseHandleParamsExtensionHTML     ParseHandleParamsExtension = "html"
	ParseHandleParamsExtensionHtm      ParseHandleParamsExtension = "htm"
	ParseHandleParamsExtensionXhtml    ParseHandleParamsExtension = "xhtml"
	ParseHandleParamsExtensionXml      ParseHandleParamsExtension = "xml"
	ParseHandleParamsExtensionRss      ParseHandleParamsExtension = "rss"
	ParseHandleParamsExtensionAtom     ParseHandleParamsExtension = "atom"
	ParseHandleParamsExtensionCsv      ParseHandleParamsExtension = "csv"
	ParseHandleParamsExtensionTsv      ParseHandleParamsExtension = "tsv"
	ParseHandleParamsExtensionYaml     ParseHandleParamsExtension = "yaml"
	ParseHandleParamsExtensionYml      ParseHandleParamsExtension = "yml"
	ParseHandleParamsExtensionPy       ParseHandleParamsExtension = "py"
	ParseHandleParamsExtensionJava     ParseHandleParamsExtension = "java"
	ParseHandleParamsExtensionJs       ParseHandleParamsExtension = "js"
	ParseHandleParamsExtensionJsx      ParseHandleParamsExtension = "jsx"
	ParseHandleParamsExtensionMjs      ParseHandleParamsExtension = "mjs"
	ParseHandleParamsExtensionCjs      ParseHandleParamsExtension = "cjs"
	ParseHandleParamsExtensionJson     ParseHandleParamsExtension = "json"
	ParseHandleParamsExtensionJSONL    ParseHandleParamsExtension = "jsonl"
	ParseHandleParamsExtensionNdjson   ParseHandleParamsExtension = "ndjson"
	ParseHandleParamsExtensionPhp      ParseHandleParamsExtension = "php"
	ParseHandleParamsExtensionSh       ParseHandleParamsExtension = "sh"
	ParseHandleParamsExtensionBash     ParseHandleParamsExtension = "bash"
	ParseHandleParamsExtensionZsh      ParseHandleParamsExtension = "zsh"
	ParseHandleParamsExtensionFish     ParseHandleParamsExtension = "fish"
	ParseHandleParamsExtensionRb       ParseHandleParamsExtension = "rb"
	ParseHandleParamsExtensionTs       ParseHandleParamsExtension = "ts"
	ParseHandleParamsExtensionTsx      ParseHandleParamsExtension = "tsx"
	ParseHandleParamsExtensionRtf      ParseHandleParamsExtension = "rtf"
	ParseHandleParamsExtensionSrt      ParseHandleParamsExtension = "srt"
	ParseHandleParamsExtensionCss      ParseHandleParamsExtension = "css"
	ParseHandleParamsExtensionScss     ParseHandleParamsExtension = "scss"
	ParseHandleParamsExtensionLess     ParseHandleParamsExtension = "less"
	ParseHandleParamsExtensionStyl     ParseHandleParamsExtension = "styl"
	ParseHandleParamsExtensionSass     ParseHandleParamsExtension = "sass"
	ParseHandleParamsExtensionSvg      ParseHandleParamsExtension = "svg"
	ParseHandleParamsExtensionPdf      ParseHandleParamsExtension = "pdf"
	ParseHandleParamsExtensionDocx     ParseHandleParamsExtension = "docx"
	ParseHandleParamsExtensionDoc      ParseHandleParamsExtension = "doc"
	ParseHandleParamsExtensionXlsx     ParseHandleParamsExtension = "xlsx"
	ParseHandleParamsExtensionXlsm     ParseHandleParamsExtension = "xlsm"
	ParseHandleParamsExtensionXlsb     ParseHandleParamsExtension = "xlsb"
	ParseHandleParamsExtensionXltx     ParseHandleParamsExtension = "xltx"
	ParseHandleParamsExtensionXltm     ParseHandleParamsExtension = "xltm"
	ParseHandleParamsExtensionXls      ParseHandleParamsExtension = "xls"
	ParseHandleParamsExtensionPptx     ParseHandleParamsExtension = "pptx"
	ParseHandleParamsExtensionPptm     ParseHandleParamsExtension = "pptm"
	ParseHandleParamsExtensionPpsx     ParseHandleParamsExtension = "ppsx"
	ParseHandleParamsExtensionPpsm     ParseHandleParamsExtension = "ppsm"
	ParseHandleParamsExtensionPotx     ParseHandleParamsExtension = "potx"
	ParseHandleParamsExtensionPotm     ParseHandleParamsExtension = "potm"
	ParseHandleParamsExtensionPpt      ParseHandleParamsExtension = "ppt"
	ParseHandleParamsExtensionPps      ParseHandleParamsExtension = "pps"
	ParseHandleParamsExtensionPot      ParseHandleParamsExtension = "pot"
	ParseHandleParamsExtensionJpg      ParseHandleParamsExtension = "jpg"
	ParseHandleParamsExtensionJpeg     ParseHandleParamsExtension = "jpeg"
	ParseHandleParamsExtensionJpe      ParseHandleParamsExtension = "jpe"
	ParseHandleParamsExtensionPng      ParseHandleParamsExtension = "png"
	ParseHandleParamsExtensionGif      ParseHandleParamsExtension = "gif"
	ParseHandleParamsExtensionBmp      ParseHandleParamsExtension = "bmp"
	ParseHandleParamsExtensionTiff     ParseHandleParamsExtension = "tiff"
	ParseHandleParamsExtensionTif      ParseHandleParamsExtension = "tif"
	ParseHandleParamsExtensionWebp     ParseHandleParamsExtension = "webp"
	ParseHandleParamsExtensionPpm      ParseHandleParamsExtension = "ppm"
	ParseHandleParamsExtensionPbm      ParseHandleParamsExtension = "pbm"
	ParseHandleParamsExtensionPgm      ParseHandleParamsExtension = "pgm"
	ParseHandleParamsExtensionPnm      ParseHandleParamsExtension = "pnm"
)

type ParseHandleParamsIncludeImagesString added in v2.5.0

type ParseHandleParamsIncludeImagesString string
const (
	ParseHandleParamsIncludeImagesStringTrue  ParseHandleParamsIncludeImagesString = "true"
	ParseHandleParamsIncludeImagesStringFalse ParseHandleParamsIncludeImagesString = "false"
)

type ParseHandleParamsIncludeImagesUnion added in v2.5.0

type ParseHandleParamsIncludeImagesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfParseHandlesIncludeImagesString)
	OfParseHandlesIncludeImagesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type ParseHandleParamsIncludeLinksString added in v2.5.0

type ParseHandleParamsIncludeLinksString string
const (
	ParseHandleParamsIncludeLinksStringTrue  ParseHandleParamsIncludeLinksString = "true"
	ParseHandleParamsIncludeLinksStringFalse ParseHandleParamsIncludeLinksString = "false"
)

type ParseHandleParamsIncludeLinksUnion added in v2.5.0

type ParseHandleParamsIncludeLinksUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfParseHandlesIncludeLinksString)
	OfParseHandlesIncludeLinksString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type ParseHandleParamsOcrString added in v2.5.0

type ParseHandleParamsOcrString string
const (
	ParseHandleParamsOcrStringTrue  ParseHandleParamsOcrString = "true"
	ParseHandleParamsOcrStringFalse ParseHandleParamsOcrString = "false"
)

type ParseHandleParamsOcrUnion added in v2.5.0

type ParseHandleParamsOcrUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfParseHandlesOcrString)
	OfParseHandlesOcrString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type ParseHandleParamsPdf added in v2.4.0

type ParseHandleParamsPdf struct {
	// Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
	// Must be greater than or equal to start when both are provided.
	End param.Opt[int64] `query:"end,omitzero" json:"-"`
	// First 1-based PDF page to parse. When omitted, parsing starts at the first page.
	Start param.Opt[int64] `query:"start,omitzero" json:"-"`
	// contains filtered or unexported fields
}

PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.

func (ParseHandleParamsPdf) URLQuery added in v2.4.0

func (r ParseHandleParamsPdf) URLQuery() (v url.Values, err error)

URLQuery serializes ParseHandleParamsPdf's query parameters as `url.Values`.

type ParseHandleParamsShortenBase64ImagesString added in v2.5.0

type ParseHandleParamsShortenBase64ImagesString string
const (
	ParseHandleParamsShortenBase64ImagesStringTrue  ParseHandleParamsShortenBase64ImagesString = "true"
	ParseHandleParamsShortenBase64ImagesStringFalse ParseHandleParamsShortenBase64ImagesString = "false"
)

type ParseHandleParamsShortenBase64ImagesUnion added in v2.5.0

type ParseHandleParamsShortenBase64ImagesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfParseHandlesShortenBase64ImagesString)
	OfParseHandlesShortenBase64ImagesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type ParseHandleParamsUseMainContentOnlyString added in v2.5.0

type ParseHandleParamsUseMainContentOnlyString string
const (
	ParseHandleParamsUseMainContentOnlyStringTrue  ParseHandleParamsUseMainContentOnlyString = "true"
	ParseHandleParamsUseMainContentOnlyStringFalse ParseHandleParamsUseMainContentOnlyString = "false"
)

type ParseHandleParamsUseMainContentOnlyUnion added in v2.5.0

type ParseHandleParamsUseMainContentOnlyUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfParseHandlesUseMainContentOnlyString)
	OfParseHandlesUseMainContentOnlyString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type ParseHandleParamsZdr added in v2.5.0

type ParseHandleParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	ParseHandleParamsZdrEnabled  ParseHandleParamsZdr = "enabled"
	ParseHandleParamsZdrDisabled ParseHandleParamsZdr = "disabled"
)

type ParseHandleResponse added in v2.3.0

type ParseHandleResponse struct {
	// Input bytes converted to GitHub Flavored Markdown
	Markdown string `json:"markdown" api:"required"`
	// Indicates success
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// Detected content type used for parsing
	//
	// Any of "html", "xml", "json", "jsonl", "text", "csv", "tsv", "markdown", "yaml",
	// "python", "java", "javascript", "php", "shell", "ruby", "typescript", "rtf",
	// "srt", "css", "scss", "less", "stylus", "sass", "svg", "pdf", "docx", "doc",
	// "xlsx", "xls", "pptx", "ppt", "jpg", "png", "gif", "bmp", "tiff", "webp", "ppm",
	// "pbm", "pgm", "pnm".
	Type ParseHandleResponseType `json:"type" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata ParseHandleResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Markdown    respjson.Field
		Success     respjson.Field
		Type        respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ParseHandleResponse) RawJSON added in v2.3.0

func (r ParseHandleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ParseHandleResponse) UnmarshalJSON added in v2.3.0

func (r *ParseHandleResponse) UnmarshalJSON(data []byte) error

type ParseHandleResponseKeyMetadata added in v2.3.0

type ParseHandleResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (ParseHandleResponseKeyMetadata) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*ParseHandleResponseKeyMetadata) UnmarshalJSON added in v2.3.0

func (r *ParseHandleResponseKeyMetadata) UnmarshalJSON(data []byte) error

type ParseHandleResponseType added in v2.3.0

type ParseHandleResponseType string

Detected content type used for parsing

const (
	ParseHandleResponseTypeHTML       ParseHandleResponseType = "html"
	ParseHandleResponseTypeXml        ParseHandleResponseType = "xml"
	ParseHandleResponseTypeJson       ParseHandleResponseType = "json"
	ParseHandleResponseTypeJSONL      ParseHandleResponseType = "jsonl"
	ParseHandleResponseTypeText       ParseHandleResponseType = "text"
	ParseHandleResponseTypeCsv        ParseHandleResponseType = "csv"
	ParseHandleResponseTypeTsv        ParseHandleResponseType = "tsv"
	ParseHandleResponseTypeMarkdown   ParseHandleResponseType = "markdown"
	ParseHandleResponseTypeYaml       ParseHandleResponseType = "yaml"
	ParseHandleResponseTypePython     ParseHandleResponseType = "python"
	ParseHandleResponseTypeJava       ParseHandleResponseType = "java"
	ParseHandleResponseTypeJavascript ParseHandleResponseType = "javascript"
	ParseHandleResponseTypePhp        ParseHandleResponseType = "php"
	ParseHandleResponseTypeShell      ParseHandleResponseType = "shell"
	ParseHandleResponseTypeRuby       ParseHandleResponseType = "ruby"
	ParseHandleResponseTypeTypescript ParseHandleResponseType = "typescript"
	ParseHandleResponseTypeRtf        ParseHandleResponseType = "rtf"
	ParseHandleResponseTypeSrt        ParseHandleResponseType = "srt"
	ParseHandleResponseTypeCss        ParseHandleResponseType = "css"
	ParseHandleResponseTypeScss       ParseHandleResponseType = "scss"
	ParseHandleResponseTypeLess       ParseHandleResponseType = "less"
	ParseHandleResponseTypeStylus     ParseHandleResponseType = "stylus"
	ParseHandleResponseTypeSass       ParseHandleResponseType = "sass"
	ParseHandleResponseTypeSvg        ParseHandleResponseType = "svg"
	ParseHandleResponseTypePdf        ParseHandleResponseType = "pdf"
	ParseHandleResponseTypeDocx       ParseHandleResponseType = "docx"
	ParseHandleResponseTypeDoc        ParseHandleResponseType = "doc"
	ParseHandleResponseTypeXlsx       ParseHandleResponseType = "xlsx"
	ParseHandleResponseTypeXls        ParseHandleResponseType = "xls"
	ParseHandleResponseTypePptx       ParseHandleResponseType = "pptx"
	ParseHandleResponseTypePpt        ParseHandleResponseType = "ppt"
	ParseHandleResponseTypeJpg        ParseHandleResponseType = "jpg"
	ParseHandleResponseTypePng        ParseHandleResponseType = "png"
	ParseHandleResponseTypeGif        ParseHandleResponseType = "gif"
	ParseHandleResponseTypeBmp        ParseHandleResponseType = "bmp"
	ParseHandleResponseTypeTiff       ParseHandleResponseType = "tiff"
	ParseHandleResponseTypeWebp       ParseHandleResponseType = "webp"
	ParseHandleResponseTypePpm        ParseHandleResponseType = "ppm"
	ParseHandleResponseTypePbm        ParseHandleResponseType = "pbm"
	ParseHandleResponseTypePgm        ParseHandleResponseType = "pgm"
	ParseHandleResponseTypePnm        ParseHandleResponseType = "pnm"
)

type ParseService added in v2.3.0

type ParseService struct {
	// contains filtered or unexported fields
}

ParseService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewParseService method instead.

func NewParseService added in v2.3.0

func NewParseService(opts ...option.RequestOption) (r ParseService)

NewParseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ParseService) Handle added in v2.3.0

func (r *ParseService) Handle(ctx context.Context, body io.Reader, params ParseHandleParams, opts ...option.RequestOption) (res *ParseHandleResponse, err error)

Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.

type UtilityPrefetchParams

type UtilityPrefetchParams struct {
	// Identifier of the brand to prefetch. Provide exactly one of domain or email.
	Identifier UtilityPrefetchParamsIdentifierUnion `json:"identifier,omitzero" api:"required"`
	// What to prefetch. Currently only 'brand' is supported.
	//
	// Any of "brand".
	Type UtilityPrefetchParamsType `json:"type,omitzero" api:"required"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (UtilityPrefetchParams) MarshalJSON

func (r UtilityPrefetchParams) MarshalJSON() (data []byte, err error)

func (*UtilityPrefetchParams) UnmarshalJSON

func (r *UtilityPrefetchParams) UnmarshalJSON(data []byte) error

type UtilityPrefetchParamsIdentifierByDomain

type UtilityPrefetchParamsIdentifierByDomain struct {
	// Domain name to prefetch brand data for
	Domain string `json:"domain" api:"required"`
	// contains filtered or unexported fields
}

Prefetch brand data by domain.

The property Domain is required.

func (UtilityPrefetchParamsIdentifierByDomain) MarshalJSON

func (r UtilityPrefetchParamsIdentifierByDomain) MarshalJSON() (data []byte, err error)

func (*UtilityPrefetchParamsIdentifierByDomain) UnmarshalJSON

func (r *UtilityPrefetchParamsIdentifierByDomain) UnmarshalJSON(data []byte) error

type UtilityPrefetchParamsIdentifierByEmail

type UtilityPrefetchParamsIdentifierByEmail struct {
	// Email address to prefetch brand data for. The domain will be extracted from the
	// email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
	// addresses are not allowed.
	Email string `json:"email" api:"required" format:"email"`
	// contains filtered or unexported fields
}

Prefetch brand data by email. The domain will be extracted and validated.

The property Email is required.

func (UtilityPrefetchParamsIdentifierByEmail) MarshalJSON

func (r UtilityPrefetchParamsIdentifierByEmail) MarshalJSON() (data []byte, err error)

func (*UtilityPrefetchParamsIdentifierByEmail) UnmarshalJSON

func (r *UtilityPrefetchParamsIdentifierByEmail) UnmarshalJSON(data []byte) error

type UtilityPrefetchParamsIdentifierUnion

type UtilityPrefetchParamsIdentifierUnion struct {
	OfByDomain *UtilityPrefetchParamsIdentifierByDomain `json:",omitzero,inline"`
	OfByEmail  *UtilityPrefetchParamsIdentifierByEmail  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (UtilityPrefetchParamsIdentifierUnion) MarshalJSON

func (u UtilityPrefetchParamsIdentifierUnion) MarshalJSON() ([]byte, error)

func (*UtilityPrefetchParamsIdentifierUnion) UnmarshalJSON

func (u *UtilityPrefetchParamsIdentifierUnion) UnmarshalJSON(data []byte) error

type UtilityPrefetchParamsType

type UtilityPrefetchParamsType string

What to prefetch. Currently only 'brand' is supported.

const (
	UtilityPrefetchParamsTypeBrand UtilityPrefetchParamsType = "brand"
)

type UtilityPrefetchResponse

type UtilityPrefetchResponse struct {
	// The domain that was queued for prefetching
	Domain string `json:"domain"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata UtilityPrefetchResponseKeyMetadata `json:"key_metadata"`
	// Success message
	Message string `json:"message"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// The type of prefetch that was queued, echoed from the request (currently always
	// 'brand')
	//
	// Any of "brand".
	Type UtilityPrefetchResponseType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		KeyMetadata respjson.Field
		Message     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UtilityPrefetchResponse) RawJSON

func (r UtilityPrefetchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UtilityPrefetchResponse) UnmarshalJSON

func (r *UtilityPrefetchResponse) UnmarshalJSON(data []byte) error

type UtilityPrefetchResponseKeyMetadata

type UtilityPrefetchResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (UtilityPrefetchResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*UtilityPrefetchResponseKeyMetadata) UnmarshalJSON

func (r *UtilityPrefetchResponseKeyMetadata) UnmarshalJSON(data []byte) error

type UtilityPrefetchResponseType

type UtilityPrefetchResponseType string

The type of prefetch that was queued, echoed from the request (currently always 'brand')

const (
	UtilityPrefetchResponseTypeBrand UtilityPrefetchResponseType = "brand"
)

type UtilityService

type UtilityService struct {
	// contains filtered or unexported fields
}

UtilityService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUtilityService method instead.

func NewUtilityService

func NewUtilityService(opts ...option.RequestOption) (r UtilityService)

NewUtilityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UtilityService) Prefetch

Signal that you may fetch brand data soon to improve latency. The type field selects what to prefetch (currently only 'brand') and identifier carries exactly one lookup key: a domain, or an email whose domain is extracted and validated (free email providers and disposable email addresses are not allowed).

type WebExtractCompetitorsParams

type WebExtractCompetitorsParams struct {
	// Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
	// and normalized to their domain.
	Domain string `query:"domain" api:"required" json:"-"`
	// Exact number of direct competitors to return. Defaults to 5.
	NumCompetitors param.Opt[int64] `query:"numCompetitors,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebExtractCompetitorsParams) URLQuery

func (r WebExtractCompetitorsParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebExtractCompetitorsParams's query parameters as `url.Values`.

type WebExtractCompetitorsResponse

type WebExtractCompetitorsResponse struct {
	// Direct competitors ordered by relevance and confidence.
	Competitors []WebExtractCompetitorsResponseCompetitor `json:"competitors" api:"required"`
	// Normalized input domain.
	Domain string `json:"domain" api:"required"`
	// Status of the response.
	//
	// Any of "ok".
	Status WebExtractCompetitorsResponseStatus `json:"status" api:"required"`
	// Target company profile inferred from the landing page.
	Target WebExtractCompetitorsResponseTarget `json:"target" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebExtractCompetitorsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Competitors respjson.Field
		Domain      respjson.Field
		Status      respjson.Field
		Target      respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractCompetitorsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponse) UnmarshalJSON

func (r *WebExtractCompetitorsResponse) UnmarshalJSON(data []byte) error

type WebExtractCompetitorsResponseCompetitor

type WebExtractCompetitorsResponseCompetitor struct {
	// Confidence that this company is a direct competitor.
	//
	// Any of "high", "medium".
	Confidence string `json:"confidence" api:"required"`
	// Short description of the competitor.
	Description string `json:"description" api:"required"`
	// Competitor's normalized official domain.
	Domain string `json:"domain" api:"required"`
	// Competitor company or product name.
	Name string `json:"name" api:"required"`
	// Search result URLs used as evidence for this competitor.
	SourceURLs []string `json:"sourceUrls" api:"required"`
	// Competitor website URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Confidence  respjson.Field
		Description respjson.Field
		Domain      respjson.Field
		Name        respjson.Field
		SourceURLs  respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractCompetitorsResponseCompetitor) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseCompetitor) UnmarshalJSON

func (r *WebExtractCompetitorsResponseCompetitor) UnmarshalJSON(data []byte) error

type WebExtractCompetitorsResponseKeyMetadata

type WebExtractCompetitorsResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebExtractCompetitorsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseKeyMetadata) UnmarshalJSON

func (r *WebExtractCompetitorsResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebExtractCompetitorsResponseStatus

type WebExtractCompetitorsResponseStatus string

Status of the response.

const (
	WebExtractCompetitorsResponseStatusOk WebExtractCompetitorsResponseStatus = "ok"
)

type WebExtractCompetitorsResponseTarget

type WebExtractCompetitorsResponseTarget struct {
	// Company or product name inferred from the landing page.
	CompanyName string `json:"companyName" api:"required"`
	// Specific operating field, product category, or market.
	Field string `json:"field" api:"required"`
	// One-sentence description of what the target company sells and who it serves.
	FieldDescription string `json:"fieldDescription" api:"required"`
	// Resolved URL used for the landing page analysis.
	WebsiteURL string `json:"websiteUrl" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompanyName      respjson.Field
		Field            respjson.Field
		FieldDescription respjson.Field
		WebsiteURL       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Target company profile inferred from the landing page.

func (WebExtractCompetitorsResponseTarget) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseTarget) UnmarshalJSON

func (r *WebExtractCompetitorsResponseTarget) UnmarshalJSON(data []byte) error

type WebExtractFontsParams

type WebExtractFontsParams struct {
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
	// 'https://example.com/design-system'). When provided, fonts are extracted from
	// this exact URL. You must provide either 'domain' or 'directUrl', but not both.
	DirectURL param.Opt[string] `query:"directUrl,omitzero" format:"uri" json:"-"`
	// Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
	// domain will be automatically normalized and validated. You must provide either
	// 'domain' or 'directUrl', but not both.
	Domain param.Opt[string] `query:"domain,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebExtractFontsParams) URLQuery

func (r WebExtractFontsParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebExtractFontsParams's query parameters as `url.Values`.

type WebExtractFontsResponse

type WebExtractFontsResponse struct {
	// HTTP status code, e.g., 200
	Code int64 `json:"code" api:"required"`
	// The normalized domain that was processed
	Domain string `json:"domain" api:"required"`
	// Array of font usage information
	Fonts []WebExtractFontsResponseFont `json:"fonts" api:"required"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status" api:"required"`
	// Font assets keyed by family name as it appears in the fonts array (non-generic
	// names only). Clients match entries in fonts to pick a file URL from files.
	// Omitted when no families resolve to Google or custom @font-face URLs.
	FontLinks map[string]WebExtractFontsResponseFontLink `json:"fontLinks"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebExtractFontsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Domain      respjson.Field
		Fonts       respjson.Field
		Status      respjson.Field
		FontLinks   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractFontsResponse) RawJSON

func (r WebExtractFontsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebExtractFontsResponse) UnmarshalJSON

func (r *WebExtractFontsResponse) UnmarshalJSON(data []byte) error

type WebExtractFontsResponseFont

type WebExtractFontsResponseFont struct {
	// Array of fallback font families
	Fallbacks []string `json:"fallbacks" api:"required"`
	// Font family name
	Font string `json:"font" api:"required"`
	// Number of elements using this font
	NumElements float64 `json:"num_elements" api:"required"`
	// Number of words using this font
	NumWords float64 `json:"num_words" api:"required"`
	// Percentage of elements using this font
	PercentElements float64 `json:"percent_elements" api:"required"`
	// Percentage of words using this font
	PercentWords float64 `json:"percent_words" api:"required"`
	// Array of CSS selectors or element types where this font is used
	Uses []string `json:"uses" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Fallbacks       respjson.Field
		Font            respjson.Field
		NumElements     respjson.Field
		NumWords        respjson.Field
		PercentElements respjson.Field
		PercentWords    respjson.Field
		Uses            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractFontsResponseFont) RawJSON

func (r WebExtractFontsResponseFont) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebExtractFontsResponseFont) UnmarshalJSON

func (r *WebExtractFontsResponseFont) UnmarshalJSON(data []byte) error
type WebExtractFontsResponseFontLink struct {
	// Upright font files keyed by weight string (e.g. "400" for regular, "500",
	// "700"). Values are absolute URLs.
	Files map[string]string `json:"files" api:"required"`
	// Any of "google", "custom".
	Type string `json:"type" api:"required"`
	// Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
	// display, handwriting). Omitted for custom fonts when unknown.
	Category string `json:"category"`
	// Present when type is custom: human-readable name derived from the fontLinks key
	// (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
	// Google entries omit this.
	DisplayName string `json:"displayName"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files       respjson.Field
		Type        respjson.Field
		Category    respjson.Field
		DisplayName respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractFontsResponseFontLink) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractFontsResponseFontLink) UnmarshalJSON

func (r *WebExtractFontsResponseFontLink) UnmarshalJSON(data []byte) error

type WebExtractFontsResponseKeyMetadata

type WebExtractFontsResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebExtractFontsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractFontsResponseKeyMetadata) UnmarshalJSON

func (r *WebExtractFontsResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebExtractParams

type WebExtractParams struct {
	// JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
	// Schema generated from a Zod object; Python users can pass the equivalent JSON
	// Schema object.
	Schema map[string]any `json:"schema,omitzero" api:"required"`
	// The starting website URL to crawl and extract from. Must include http:// or
	// https://.
	URL string `json:"url" api:"required" format:"uri"`
	// When true, every returned value must be grounded in facts stated on the page;
	// fields that cannot be supported by the page are returned as null/empty. When
	// false (default), the model may make reasonable inferences and derivations from
	// the page content (e.g. ideal customer, competitor analysis, recommendations)
	// while keeping verifiable specifics (names, quotes, URLs, dates, metrics)
	// faithful to the source.
	FactCheck param.Opt[bool] `json:"factCheck,omitzero"`
	// When true, follow links on subdomains of the starting URL's domain.
	FollowSubdomains param.Opt[bool] `json:"followSubdomains,omitzero"`
	// When true, iframe contents are included in Markdown before extraction.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Optional extraction guidance, such as which facts to prioritize or how to
	// interpret fields in the schema.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Return cached scrape results if a prior scrape for the same parameters is
	// younger than this many milliseconds. Defaults to 7 days (604800000 ms).
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	// If omitted, there is no crawl depth limit.
	MaxDepth param.Opt[int64] `json:"maxDepth,omitzero"`
	// Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.
	MaxPages param.Opt[int64] `json:"maxPages,omitzero"`
	// When true, waits briefly for CSS and transition animations to settle before
	// extracting each crawled page. Defaults to false. This adds a bit of latency in
	// exchange for more stable output on animated pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
	// (110s). Default: 80000 (80s).
	StopAfterMs param.Opt[int64] `json:"stopAfterMs,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Optional browser wait time in milliseconds after initial page load for each
	// crawled page.
	WaitForMs param.Opt[int64]    `json:"waitForMs,omitzero"`
	Pdf       WebExtractParamsPdf `json:"pdf,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (WebExtractParams) MarshalJSON

func (r WebExtractParams) MarshalJSON() (data []byte, err error)

func (*WebExtractParams) UnmarshalJSON

func (r *WebExtractParams) UnmarshalJSON(data []byte) error

type WebExtractParamsPdf

type WebExtractParamsPdf struct {
	// Last 1-based PDF page to parse. Must be greater than or equal to start when both
	// are provided.
	End param.Opt[int64] `json:"end,omitzero"`
	// When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

func (WebExtractParamsPdf) MarshalJSON

func (r WebExtractParamsPdf) MarshalJSON() (data []byte, err error)

func (*WebExtractParamsPdf) UnmarshalJSON

func (r *WebExtractParamsPdf) UnmarshalJSON(data []byte) error

type WebExtractResponse

type WebExtractResponse struct {
	// Extracted data matching the request schema
	Data     map[string]any             `json:"data" api:"required"`
	Metadata WebExtractResponseMetadata `json:"metadata" api:"required"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status" api:"required"`
	// The starting URL that was analyzed
	URL string `json:"url" api:"required"`
	// List of URLs whose Markdown was used for extraction
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebExtractResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		Metadata     respjson.Field
		Status       respjson.Field
		URL          respjson.Field
		URLsAnalyzed respjson.Field
		KeyMetadata  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractResponse) RawJSON

func (r WebExtractResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebExtractResponse) UnmarshalJSON

func (r *WebExtractResponse) UnmarshalJSON(data []byte) error

type WebExtractResponseKeyMetadata

type WebExtractResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebExtractResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractResponseKeyMetadata) UnmarshalJSON

func (r *WebExtractResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebExtractResponseMetadata

type WebExtractResponseMetadata struct {
	MaxCrawlDepth int64 `json:"maxCrawlDepth" api:"required"`
	// Number of crawled pages excluded because they were anti-bot challenges, error
	// pages, or parked-domain placeholders.
	NumBlocked   int64 `json:"numBlocked" api:"required"`
	NumFailed    int64 `json:"numFailed" api:"required"`
	NumSkipped   int64 `json:"numSkipped" api:"required"`
	NumSucceeded int64 `json:"numSucceeded" api:"required"`
	NumURLs      int64 `json:"numUrls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxCrawlDepth respjson.Field
		NumBlocked    respjson.Field
		NumFailed     respjson.Field
		NumSkipped    respjson.Field
		NumSucceeded  respjson.Field
		NumURLs       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractResponseMetadata) RawJSON

func (r WebExtractResponseMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebExtractResponseMetadata) UnmarshalJSON

func (r *WebExtractResponseMetadata) UnmarshalJSON(data []byte) error

type WebExtractStyleguideParams

type WebExtractStyleguideParams struct {
	// Maximum age in milliseconds for cached brand data before the API performs a hard
	// refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
	// are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
	// year.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// A specific URL to fetch the styleguide from directly, bypassing domain
	// resolution (e.g., 'https://example.com/design-system'). When provided, the
	// styleguide is extracted from this exact URL. You must provide either 'domain' or
	// 'directUrl', but not both.
	DirectURL param.Opt[string] `query:"directUrl,omitzero" format:"uri" json:"-"`
	// Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
	// domain will be automatically normalized and validated. You must provide either
	// 'domain' or 'directUrl', but not both.
	Domain param.Opt[string] `query:"domain,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional browser color scheme to emulate for websites that respond to
	// prefers-color-scheme. This value is part of the styleguide cache key.
	//
	// Any of "light", "dark".
	ColorScheme WebExtractStyleguideParamsColorScheme `query:"colorScheme,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebExtractStyleguideParams) URLQuery

func (r WebExtractStyleguideParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebExtractStyleguideParams's query parameters as `url.Values`.

type WebExtractStyleguideParamsColorScheme

type WebExtractStyleguideParamsColorScheme string

Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.

const (
	WebExtractStyleguideParamsColorSchemeLight WebExtractStyleguideParamsColorScheme = "light"
	WebExtractStyleguideParamsColorSchemeDark  WebExtractStyleguideParamsColorScheme = "dark"
)

type WebExtractStyleguideResponse

type WebExtractStyleguideResponse struct {
	// HTTP status code
	Code int64 `json:"code"`
	// The normalized domain that was processed
	Domain string `json:"domain"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebExtractStyleguideResponseKeyMetadata `json:"key_metadata"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// Comprehensive styleguide data extracted from the website
	Styleguide WebExtractStyleguideResponseStyleguide `json:"styleguide"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Domain      respjson.Field
		KeyMetadata respjson.Field
		Status      respjson.Field
		Styleguide  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponse) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponse) UnmarshalJSON

func (r *WebExtractStyleguideResponse) UnmarshalJSON(data []byte) error

type WebExtractStyleguideResponseKeyMetadata

type WebExtractStyleguideResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebExtractStyleguideResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseKeyMetadata) UnmarshalJSON

func (r *WebExtractStyleguideResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebExtractStyleguideResponseStyleguide

type WebExtractStyleguideResponseStyleguide struct {
	// Primary colors used on the website
	Colors WebExtractStyleguideResponseStyleguideColors `json:"colors" api:"required"`
	// UI component styles
	Components WebExtractStyleguideResponseStyleguideComponents `json:"components" api:"required"`
	// Spacing system used on the website
	ElementSpacing WebExtractStyleguideResponseStyleguideElementSpacing `json:"elementSpacing" api:"required"`
	// Font assets keyed by family name as it appears in fontFamily/fontFallbacks
	// (non-generic names only). Clients match typography.fontFamily / fontWeight or
	// button styles to pick a file URL from files.
	FontLinks map[string]WebExtractStyleguideResponseStyleguideFontLink `json:"fontLinks" api:"required"`
	// The primary color mode of the website design
	//
	// Any of "light", "dark".
	Mode string `json:"mode" api:"required"`
	// Shadow styles used on the website
	Shadows WebExtractStyleguideResponseStyleguideShadows `json:"shadows" api:"required"`
	// Typography styles used on the website
	Typography WebExtractStyleguideResponseStyleguideTypography `json:"typography" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors         respjson.Field
		Components     respjson.Field
		ElementSpacing respjson.Field
		FontLinks      respjson.Field
		Mode           respjson.Field
		Shadows        respjson.Field
		Typography     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Comprehensive styleguide data extracted from the website

func (WebExtractStyleguideResponseStyleguide) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguide) UnmarshalJSON

func (r *WebExtractStyleguideResponseStyleguide) UnmarshalJSON(data []byte) error

type WebExtractStyleguideResponseStyleguideColors

type WebExtractStyleguideResponseStyleguideColors struct {
	// Accent color (hex format)
	Accent string `json:"accent" api:"required"`
	// Background color (hex format)
	Background string `json:"background" api:"required"`
	// Text color (hex format)
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Accent      respjson.Field
		Background  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Primary colors used on the website

func (WebExtractStyleguideResponseStyleguideColors) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideColors) UnmarshalJSON

func (r *WebExtractStyleguideResponseStyleguideColors) UnmarshalJSON(data []byte) error

type WebExtractStyleguideResponseStyleguideComponents

type WebExtractStyleguideResponseStyleguideComponents struct {
	// Button component styles
	Button WebExtractStyleguideResponseStyleguideComponentsButton `json:"button" api:"required"`
	// Card component style
	Card WebExtractStyleguideResponseStyleguideComponentsCard `json:"card"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Button      respjson.Field
		Card        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UI component styles

func (WebExtractStyleguideResponseStyleguideComponents) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponents) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButton

type WebExtractStyleguideResponseStyleguideComponentsButton struct {
	Link      WebExtractStyleguideResponseStyleguideComponentsButtonLink      `json:"link"`
	Primary   WebExtractStyleguideResponseStyleguideComponentsButtonPrimary   `json:"primary"`
	Secondary WebExtractStyleguideResponseStyleguideComponentsButtonSecondary `json:"secondary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Link        respjson.Field
		Primary     respjson.Field
		Secondary   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Button component styles

func (WebExtractStyleguideResponseStyleguideComponentsButton) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButton) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonLink struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Sampled minimum width of the button box (typically px)
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonLink) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonLink) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonPrimary

type WebExtractStyleguideResponseStyleguideComponentsButtonPrimary struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Sampled minimum width of the button box (typically px)
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonSecondary

type WebExtractStyleguideResponseStyleguideComponentsButtonSecondary struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Sampled minimum width of the button box (typically px)
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsCard

type WebExtractStyleguideResponseStyleguideComponentsCard struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	BoxShadow    string `json:"boxShadow" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css       string `json:"css" api:"required"`
	Padding   string `json:"padding" api:"required"`
	TextColor string `json:"textColor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor respjson.Field
		BorderColor     respjson.Field
		BorderRadius    respjson.Field
		BorderStyle     respjson.Field
		BorderWidth     respjson.Field
		BoxShadow       respjson.Field
		Css             respjson.Field
		Padding         respjson.Field
		TextColor       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Card component style

func (WebExtractStyleguideResponseStyleguideComponentsCard) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsCard) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideElementSpacing

type WebExtractStyleguideResponseStyleguideElementSpacing struct {
	Lg string `json:"lg" api:"required"`
	Md string `json:"md" api:"required"`
	Sm string `json:"sm" api:"required"`
	Xl string `json:"xl" api:"required"`
	Xs string `json:"xs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lg          respjson.Field
		Md          respjson.Field
		Sm          respjson.Field
		Xl          respjson.Field
		Xs          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Spacing system used on the website

func (WebExtractStyleguideResponseStyleguideElementSpacing) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideElementSpacing) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideFontLink struct {
	// Upright font files keyed by weight string (e.g. "400" for regular, "500",
	// "700"). Values are absolute URLs.
	Files map[string]string `json:"files" api:"required"`
	// Any of "google", "custom".
	Type string `json:"type" api:"required"`
	// Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
	// display, handwriting). Omitted for custom fonts when unknown.
	Category string `json:"category"`
	// Present when type is custom: human-readable name derived from the fontLinks key
	// (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
	// Google entries omit this.
	DisplayName string `json:"displayName"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files       respjson.Field
		Type        respjson.Field
		Category    respjson.Field
		DisplayName respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideFontLink) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideFontLink) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideShadows

type WebExtractStyleguideResponseStyleguideShadows struct {
	Inner string `json:"inner" api:"required"`
	Lg    string `json:"lg" api:"required"`
	Md    string `json:"md" api:"required"`
	Sm    string `json:"sm" api:"required"`
	Xl    string `json:"xl" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Inner       respjson.Field
		Lg          respjson.Field
		Md          respjson.Field
		Sm          respjson.Field
		Xl          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Shadow styles used on the website

func (WebExtractStyleguideResponseStyleguideShadows) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideShadows) UnmarshalJSON

func (r *WebExtractStyleguideResponseStyleguideShadows) UnmarshalJSON(data []byte) error

type WebExtractStyleguideResponseStyleguideTypography

type WebExtractStyleguideResponseStyleguideTypography struct {
	// Heading styles
	Headings WebExtractStyleguideResponseStyleguideTypographyHeadings `json:"headings" api:"required"`
	P        WebExtractStyleguideResponseStyleguideTypographyP        `json:"p"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headings    respjson.Field
		P           respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Typography styles used on the website

func (WebExtractStyleguideResponseStyleguideTypography) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypography) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadings

type WebExtractStyleguideResponseStyleguideTypographyHeadings struct {
	H1 WebExtractStyleguideResponseStyleguideTypographyHeadingsH1 `json:"h1"`
	H2 WebExtractStyleguideResponseStyleguideTypographyHeadingsH2 `json:"h2"`
	H3 WebExtractStyleguideResponseStyleguideTypographyHeadingsH3 `json:"h3"`
	H4 WebExtractStyleguideResponseStyleguideTypographyHeadingsH4 `json:"h4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		H1          respjson.Field
		H2          respjson.Field
		H3          respjson.Field
		H4          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Heading styles

func (WebExtractStyleguideResponseStyleguideTypographyHeadings) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadings) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH1

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH1 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// Primary face (first family in the computed stack)
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH2

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH2 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// Primary face (first family in the computed stack)
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH3

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH3 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// Primary face (first family in the computed stack)
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH4

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH4 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// Primary face (first family in the computed stack)
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyP

type WebExtractStyleguideResponseStyleguideTypographyP struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// Primary face (first family in the computed stack)
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyP) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyP) UnmarshalJSON

type WebScreenshotParams

type WebScreenshotParams struct {
	// Return a cached screenshot if a prior screenshot for the same parameters exists
	// and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional vertical scroll offset in pixels for capturing a long page in
	// viewport-sized chunks. When provided, the full page is captured once and the
	// returned image is the viewport-sized slice that begins at this Y offset (e.g.
	// request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page
	// top to bottom). The final slice may be shorter than the viewport height. Takes
	// precedence over fullScreenshot. Max: 100000.
	ScrollOffset param.Opt[int64] `query:"scrollOffset,omitzero" json:"-"`
	// Optional browser wait time in milliseconds after initial page load before taking
	// the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
	// omitted.
	WaitForMs param.Opt[int64] `query:"waitForMs,omitzero" json:"-"`
	// A specific URL to screenshot directly, bypassing domain resolution (e.g.,
	// 'https://example.com/pricing'). When provided, the screenshot is taken of this
	// exact URL. You must provide either 'domain' or 'directUrl', but not both.
	DirectURL param.Opt[string] `query:"directUrl,omitzero" format:"uri" json:"-"`
	// Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The
	// domain will be automatically normalized and validated. You must provide either
	// 'domain' or 'directUrl', but not both.
	Domain param.Opt[string] `query:"domain,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional parameter to choose the site's visual theme in the screenshot. Use
	// 'light' or 'dark' when the site offers both appearances.
	//
	// Any of "light", "dark".
	ColorScheme WebScreenshotParamsColorScheme `query:"colorScheme,omitzero" json:"-"`
	// Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
	// residential proxy exit location. Must be one of Context.dev's supported
	// countries. When provided, Context.dev fetches the target page from that country.
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebScreenshotParamsCountry `query:"country,omitzero" json:"-"`
	// Optional parameter to determine screenshot type. If 'true', takes a full page
	// screenshot capturing all content. If 'false' or not provided, takes a viewport
	// screenshot (standard browser view).
	//
	// Any of "true", "false".
	FullScreenshot WebScreenshotParamsFullScreenshot `query:"fullScreenshot,omitzero" json:"-"`
	// Optional parameter to control cookie/consent popup handling. If 'true', we
	// dismiss cookie banner before capture. If 'false' or not provided, captures the
	// page without that step.
	HandleCookiePopup WebScreenshotParamsHandleCookiePopupUnion `query:"handleCookiePopup,omitzero" json:"-"`
	// Optional parameter to specify which page type to screenshot. If provided, the
	// system will scrape the domain's links and use heuristics to find the most
	// appropriate URL for the specified page type (30 supported languages). If not
	// provided, screenshots the main domain landing page. Only applicable when using
	// 'domain', not 'directUrl'.
	//
	// Any of "login", "signup", "blog", "careers", "pricing", "terms", "privacy",
	// "contact".
	Page WebScreenshotParamsPage `query:"page,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
	Viewport WebScreenshotParamsViewport `query:"viewport,omitzero" json:"-"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr WebScreenshotParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebScreenshotParams) URLQuery

func (r WebScreenshotParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebScreenshotParams's query parameters as `url.Values`.

type WebScreenshotParamsColorScheme

type WebScreenshotParamsColorScheme string

Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.

const (
	WebScreenshotParamsColorSchemeLight WebScreenshotParamsColorScheme = "light"
	WebScreenshotParamsColorSchemeDark  WebScreenshotParamsColorScheme = "dark"
)

type WebScreenshotParamsCountry

type WebScreenshotParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.

const (
	WebScreenshotParamsCountryAd WebScreenshotParamsCountry = "ad"
	WebScreenshotParamsCountryAe WebScreenshotParamsCountry = "ae"
	WebScreenshotParamsCountryAf WebScreenshotParamsCountry = "af"
	WebScreenshotParamsCountryAg WebScreenshotParamsCountry = "ag"
	WebScreenshotParamsCountryAI WebScreenshotParamsCountry = "ai"
	WebScreenshotParamsCountryAl WebScreenshotParamsCountry = "al"
	WebScreenshotParamsCountryAm WebScreenshotParamsCountry = "am"
	WebScreenshotParamsCountryAo WebScreenshotParamsCountry = "ao"
	WebScreenshotParamsCountryAr WebScreenshotParamsCountry = "ar"
	WebScreenshotParamsCountryAt WebScreenshotParamsCountry = "at"
	WebScreenshotParamsCountryAu WebScreenshotParamsCountry = "au"
	WebScreenshotParamsCountryAw WebScreenshotParamsCountry = "aw"
	WebScreenshotParamsCountryAz WebScreenshotParamsCountry = "az"
	WebScreenshotParamsCountryBa WebScreenshotParamsCountry = "ba"
	WebScreenshotParamsCountryBb WebScreenshotParamsCountry = "bb"
	WebScreenshotParamsCountryBd WebScreenshotParamsCountry = "bd"
	WebScreenshotParamsCountryBe WebScreenshotParamsCountry = "be"
	WebScreenshotParamsCountryBf WebScreenshotParamsCountry = "bf"
	WebScreenshotParamsCountryBg WebScreenshotParamsCountry = "bg"
	WebScreenshotParamsCountryBh WebScreenshotParamsCountry = "bh"
	WebScreenshotParamsCountryBi WebScreenshotParamsCountry = "bi"
	WebScreenshotParamsCountryBj WebScreenshotParamsCountry = "bj"
	WebScreenshotParamsCountryBm WebScreenshotParamsCountry = "bm"
	WebScreenshotParamsCountryBn WebScreenshotParamsCountry = "bn"
	WebScreenshotParamsCountryBo WebScreenshotParamsCountry = "bo"
	WebScreenshotParamsCountryBq WebScreenshotParamsCountry = "bq"
	WebScreenshotParamsCountryBr WebScreenshotParamsCountry = "br"
	WebScreenshotParamsCountryBs WebScreenshotParamsCountry = "bs"
	WebScreenshotParamsCountryBw WebScreenshotParamsCountry = "bw"
	WebScreenshotParamsCountryBy WebScreenshotParamsCountry = "by"
	WebScreenshotParamsCountryBz WebScreenshotParamsCountry = "bz"
	WebScreenshotParamsCountryCa WebScreenshotParamsCountry = "ca"
	WebScreenshotParamsCountryCd WebScreenshotParamsCountry = "cd"
	WebScreenshotParamsCountryCf WebScreenshotParamsCountry = "cf"
	WebScreenshotParamsCountryCg WebScreenshotParamsCountry = "cg"
	WebScreenshotParamsCountryCh WebScreenshotParamsCountry = "ch"
	WebScreenshotParamsCountryCi WebScreenshotParamsCountry = "ci"
	WebScreenshotParamsCountryCl WebScreenshotParamsCountry = "cl"
	WebScreenshotParamsCountryCm WebScreenshotParamsCountry = "cm"
	WebScreenshotParamsCountryCn WebScreenshotParamsCountry = "cn"
	WebScreenshotParamsCountryCo WebScreenshotParamsCountry = "co"
	WebScreenshotParamsCountryCr WebScreenshotParamsCountry = "cr"
	WebScreenshotParamsCountryCv WebScreenshotParamsCountry = "cv"
	WebScreenshotParamsCountryCw WebScreenshotParamsCountry = "cw"
	WebScreenshotParamsCountryCy WebScreenshotParamsCountry = "cy"
	WebScreenshotParamsCountryCz WebScreenshotParamsCountry = "cz"
	WebScreenshotParamsCountryDe WebScreenshotParamsCountry = "de"
	WebScreenshotParamsCountryDj WebScreenshotParamsCountry = "dj"
	WebScreenshotParamsCountryDk WebScreenshotParamsCountry = "dk"
	WebScreenshotParamsCountryDm WebScreenshotParamsCountry = "dm"
	WebScreenshotParamsCountryDo WebScreenshotParamsCountry = "do"
	WebScreenshotParamsCountryDz WebScreenshotParamsCountry = "dz"
	WebScreenshotParamsCountryEc WebScreenshotParamsCountry = "ec"
	WebScreenshotParamsCountryEe WebScreenshotParamsCountry = "ee"
	WebScreenshotParamsCountryEg WebScreenshotParamsCountry = "eg"
	WebScreenshotParamsCountryEs WebScreenshotParamsCountry = "es"
	WebScreenshotParamsCountryEt WebScreenshotParamsCountry = "et"
	WebScreenshotParamsCountryFi WebScreenshotParamsCountry = "fi"
	WebScreenshotParamsCountryFj WebScreenshotParamsCountry = "fj"
	WebScreenshotParamsCountryFr WebScreenshotParamsCountry = "fr"
	WebScreenshotParamsCountryGa WebScreenshotParamsCountry = "ga"
	WebScreenshotParamsCountryGB WebScreenshotParamsCountry = "gb"
	WebScreenshotParamsCountryGd WebScreenshotParamsCountry = "gd"
	WebScreenshotParamsCountryGe WebScreenshotParamsCountry = "ge"
	WebScreenshotParamsCountryGf WebScreenshotParamsCountry = "gf"
	WebScreenshotParamsCountryGg WebScreenshotParamsCountry = "gg"
	WebScreenshotParamsCountryGh WebScreenshotParamsCountry = "gh"
	WebScreenshotParamsCountryGm WebScreenshotParamsCountry = "gm"
	WebScreenshotParamsCountryGn WebScreenshotParamsCountry = "gn"
	WebScreenshotParamsCountryGp WebScreenshotParamsCountry = "gp"
	WebScreenshotParamsCountryGq WebScreenshotParamsCountry = "gq"
	WebScreenshotParamsCountryGr WebScreenshotParamsCountry = "gr"
	WebScreenshotParamsCountryGt WebScreenshotParamsCountry = "gt"
	WebScreenshotParamsCountryGu WebScreenshotParamsCountry = "gu"
	WebScreenshotParamsCountryGw WebScreenshotParamsCountry = "gw"
	WebScreenshotParamsCountryGy WebScreenshotParamsCountry = "gy"
	WebScreenshotParamsCountryHk WebScreenshotParamsCountry = "hk"
	WebScreenshotParamsCountryHn WebScreenshotParamsCountry = "hn"
	WebScreenshotParamsCountryHr WebScreenshotParamsCountry = "hr"
	WebScreenshotParamsCountryHt WebScreenshotParamsCountry = "ht"
	WebScreenshotParamsCountryHu WebScreenshotParamsCountry = "hu"
	WebScreenshotParamsCountryID WebScreenshotParamsCountry = "id"
	WebScreenshotParamsCountryIe WebScreenshotParamsCountry = "ie"
	WebScreenshotParamsCountryIl WebScreenshotParamsCountry = "il"
	WebScreenshotParamsCountryIm WebScreenshotParamsCountry = "im"
	WebScreenshotParamsCountryIn WebScreenshotParamsCountry = "in"
	WebScreenshotParamsCountryIq WebScreenshotParamsCountry = "iq"
	WebScreenshotParamsCountryIr WebScreenshotParamsCountry = "ir"
	WebScreenshotParamsCountryIs WebScreenshotParamsCountry = "is"
	WebScreenshotParamsCountryIt WebScreenshotParamsCountry = "it"
	WebScreenshotParamsCountryJe WebScreenshotParamsCountry = "je"
	WebScreenshotParamsCountryJm WebScreenshotParamsCountry = "jm"
	WebScreenshotParamsCountryJo WebScreenshotParamsCountry = "jo"
	WebScreenshotParamsCountryJp WebScreenshotParamsCountry = "jp"
	WebScreenshotParamsCountryKe WebScreenshotParamsCountry = "ke"
	WebScreenshotParamsCountryKg WebScreenshotParamsCountry = "kg"
	WebScreenshotParamsCountryKh WebScreenshotParamsCountry = "kh"
	WebScreenshotParamsCountryKn WebScreenshotParamsCountry = "kn"
	WebScreenshotParamsCountryKr WebScreenshotParamsCountry = "kr"
	WebScreenshotParamsCountryKw WebScreenshotParamsCountry = "kw"
	WebScreenshotParamsCountryKy WebScreenshotParamsCountry = "ky"
	WebScreenshotParamsCountryKz WebScreenshotParamsCountry = "kz"
	WebScreenshotParamsCountryLa WebScreenshotParamsCountry = "la"
	WebScreenshotParamsCountryLb WebScreenshotParamsCountry = "lb"
	WebScreenshotParamsCountryLc WebScreenshotParamsCountry = "lc"
	WebScreenshotParamsCountryLk WebScreenshotParamsCountry = "lk"
	WebScreenshotParamsCountryLr WebScreenshotParamsCountry = "lr"
	WebScreenshotParamsCountryLs WebScreenshotParamsCountry = "ls"
	WebScreenshotParamsCountryLt WebScreenshotParamsCountry = "lt"
	WebScreenshotParamsCountryLu WebScreenshotParamsCountry = "lu"
	WebScreenshotParamsCountryLv WebScreenshotParamsCountry = "lv"
	WebScreenshotParamsCountryLy WebScreenshotParamsCountry = "ly"
	WebScreenshotParamsCountryMa WebScreenshotParamsCountry = "ma"
	WebScreenshotParamsCountryMc WebScreenshotParamsCountry = "mc"
	WebScreenshotParamsCountryMd WebScreenshotParamsCountry = "md"
	WebScreenshotParamsCountryMe WebScreenshotParamsCountry = "me"
	WebScreenshotParamsCountryMf WebScreenshotParamsCountry = "mf"
	WebScreenshotParamsCountryMg WebScreenshotParamsCountry = "mg"
	WebScreenshotParamsCountryMk WebScreenshotParamsCountry = "mk"
	WebScreenshotParamsCountryMl WebScreenshotParamsCountry = "ml"
	WebScreenshotParamsCountryMm WebScreenshotParamsCountry = "mm"
	WebScreenshotParamsCountryMn WebScreenshotParamsCountry = "mn"
	WebScreenshotParamsCountryMo WebScreenshotParamsCountry = "mo"
	WebScreenshotParamsCountryMq WebScreenshotParamsCountry = "mq"
	WebScreenshotParamsCountryMr WebScreenshotParamsCountry = "mr"
	WebScreenshotParamsCountryMt WebScreenshotParamsCountry = "mt"
	WebScreenshotParamsCountryMu WebScreenshotParamsCountry = "mu"
	WebScreenshotParamsCountryMv WebScreenshotParamsCountry = "mv"
	WebScreenshotParamsCountryMw WebScreenshotParamsCountry = "mw"
	WebScreenshotParamsCountryMx WebScreenshotParamsCountry = "mx"
	WebScreenshotParamsCountryMy WebScreenshotParamsCountry = "my"
	WebScreenshotParamsCountryMz WebScreenshotParamsCountry = "mz"
	WebScreenshotParamsCountryNa WebScreenshotParamsCountry = "na"
	WebScreenshotParamsCountryNc WebScreenshotParamsCountry = "nc"
	WebScreenshotParamsCountryNe WebScreenshotParamsCountry = "ne"
	WebScreenshotParamsCountryNg WebScreenshotParamsCountry = "ng"
	WebScreenshotParamsCountryNi WebScreenshotParamsCountry = "ni"
	WebScreenshotParamsCountryNl WebScreenshotParamsCountry = "nl"
	WebScreenshotParamsCountryNo WebScreenshotParamsCountry = "no"
	WebScreenshotParamsCountryNp WebScreenshotParamsCountry = "np"
	WebScreenshotParamsCountryNz WebScreenshotParamsCountry = "nz"
	WebScreenshotParamsCountryOm WebScreenshotParamsCountry = "om"
	WebScreenshotParamsCountryPa WebScreenshotParamsCountry = "pa"
	WebScreenshotParamsCountryPe WebScreenshotParamsCountry = "pe"
	WebScreenshotParamsCountryPf WebScreenshotParamsCountry = "pf"
	WebScreenshotParamsCountryPg WebScreenshotParamsCountry = "pg"
	WebScreenshotParamsCountryPh WebScreenshotParamsCountry = "ph"
	WebScreenshotParamsCountryPk WebScreenshotParamsCountry = "pk"
	WebScreenshotParamsCountryPl WebScreenshotParamsCountry = "pl"
	WebScreenshotParamsCountryPr WebScreenshotParamsCountry = "pr"
	WebScreenshotParamsCountryPs WebScreenshotParamsCountry = "ps"
	WebScreenshotParamsCountryPt WebScreenshotParamsCountry = "pt"
	WebScreenshotParamsCountryPy WebScreenshotParamsCountry = "py"
	WebScreenshotParamsCountryQa WebScreenshotParamsCountry = "qa"
	WebScreenshotParamsCountryRe WebScreenshotParamsCountry = "re"
	WebScreenshotParamsCountryRo WebScreenshotParamsCountry = "ro"
	WebScreenshotParamsCountryRs WebScreenshotParamsCountry = "rs"
	WebScreenshotParamsCountryRu WebScreenshotParamsCountry = "ru"
	WebScreenshotParamsCountryRw WebScreenshotParamsCountry = "rw"
	WebScreenshotParamsCountrySa WebScreenshotParamsCountry = "sa"
	WebScreenshotParamsCountrySc WebScreenshotParamsCountry = "sc"
	WebScreenshotParamsCountrySd WebScreenshotParamsCountry = "sd"
	WebScreenshotParamsCountrySe WebScreenshotParamsCountry = "se"
	WebScreenshotParamsCountrySg WebScreenshotParamsCountry = "sg"
	WebScreenshotParamsCountrySi WebScreenshotParamsCountry = "si"
	WebScreenshotParamsCountrySk WebScreenshotParamsCountry = "sk"
	WebScreenshotParamsCountrySl WebScreenshotParamsCountry = "sl"
	WebScreenshotParamsCountrySm WebScreenshotParamsCountry = "sm"
	WebScreenshotParamsCountrySn WebScreenshotParamsCountry = "sn"
	WebScreenshotParamsCountrySo WebScreenshotParamsCountry = "so"
	WebScreenshotParamsCountrySr WebScreenshotParamsCountry = "sr"
	WebScreenshotParamsCountrySS WebScreenshotParamsCountry = "ss"
	WebScreenshotParamsCountrySt WebScreenshotParamsCountry = "st"
	WebScreenshotParamsCountrySv WebScreenshotParamsCountry = "sv"
	WebScreenshotParamsCountrySx WebScreenshotParamsCountry = "sx"
	WebScreenshotParamsCountrySy WebScreenshotParamsCountry = "sy"
	WebScreenshotParamsCountrySz WebScreenshotParamsCountry = "sz"
	WebScreenshotParamsCountryTc WebScreenshotParamsCountry = "tc"
	WebScreenshotParamsCountryTd WebScreenshotParamsCountry = "td"
	WebScreenshotParamsCountryTg WebScreenshotParamsCountry = "tg"
	WebScreenshotParamsCountryTh WebScreenshotParamsCountry = "th"
	WebScreenshotParamsCountryTj WebScreenshotParamsCountry = "tj"
	WebScreenshotParamsCountryTl WebScreenshotParamsCountry = "tl"
	WebScreenshotParamsCountryTm WebScreenshotParamsCountry = "tm"
	WebScreenshotParamsCountryTn WebScreenshotParamsCountry = "tn"
	WebScreenshotParamsCountryTr WebScreenshotParamsCountry = "tr"
	WebScreenshotParamsCountryTt WebScreenshotParamsCountry = "tt"
	WebScreenshotParamsCountryTw WebScreenshotParamsCountry = "tw"
	WebScreenshotParamsCountryTz WebScreenshotParamsCountry = "tz"
	WebScreenshotParamsCountryUa WebScreenshotParamsCountry = "ua"
	WebScreenshotParamsCountryUg WebScreenshotParamsCountry = "ug"
	WebScreenshotParamsCountryUs WebScreenshotParamsCountry = "us"
	WebScreenshotParamsCountryUy WebScreenshotParamsCountry = "uy"
	WebScreenshotParamsCountryUz WebScreenshotParamsCountry = "uz"
	WebScreenshotParamsCountryVc WebScreenshotParamsCountry = "vc"
	WebScreenshotParamsCountryVe WebScreenshotParamsCountry = "ve"
	WebScreenshotParamsCountryVg WebScreenshotParamsCountry = "vg"
	WebScreenshotParamsCountryVi WebScreenshotParamsCountry = "vi"
	WebScreenshotParamsCountryVn WebScreenshotParamsCountry = "vn"
	WebScreenshotParamsCountryYe WebScreenshotParamsCountry = "ye"
	WebScreenshotParamsCountryYt WebScreenshotParamsCountry = "yt"
	WebScreenshotParamsCountryZa WebScreenshotParamsCountry = "za"
	WebScreenshotParamsCountryZm WebScreenshotParamsCountry = "zm"
	WebScreenshotParamsCountryZw WebScreenshotParamsCountry = "zw"
)

type WebScreenshotParamsFullScreenshot

type WebScreenshotParamsFullScreenshot string

Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).

const (
	WebScreenshotParamsFullScreenshotTrue  WebScreenshotParamsFullScreenshot = "true"
	WebScreenshotParamsFullScreenshotFalse WebScreenshotParamsFullScreenshot = "false"
)

type WebScreenshotParamsHandleCookiePopupString added in v2.5.0

type WebScreenshotParamsHandleCookiePopupString string
const (
	WebScreenshotParamsHandleCookiePopupStringTrue  WebScreenshotParamsHandleCookiePopupString = "true"
	WebScreenshotParamsHandleCookiePopupStringFalse WebScreenshotParamsHandleCookiePopupString = "false"
)

type WebScreenshotParamsHandleCookiePopupUnion added in v2.5.0

type WebScreenshotParamsHandleCookiePopupUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebScreenshotsHandleCookiePopupString)
	OfWebScreenshotsHandleCookiePopupString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebScreenshotParamsPage

type WebScreenshotParamsPage string

Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.

const (
	WebScreenshotParamsPageLogin   WebScreenshotParamsPage = "login"
	WebScreenshotParamsPageSignup  WebScreenshotParamsPage = "signup"
	WebScreenshotParamsPageBlog    WebScreenshotParamsPage = "blog"
	WebScreenshotParamsPageCareers WebScreenshotParamsPage = "careers"
	WebScreenshotParamsPagePricing WebScreenshotParamsPage = "pricing"
	WebScreenshotParamsPageTerms   WebScreenshotParamsPage = "terms"
	WebScreenshotParamsPagePrivacy WebScreenshotParamsPage = "privacy"
	WebScreenshotParamsPageContact WebScreenshotParamsPage = "contact"
)

type WebScreenshotParamsViewport

type WebScreenshotParamsViewport struct {
	// Viewport height in pixels.
	Height param.Opt[int64] `query:"height,omitzero" json:"-"`
	// Viewport width in pixels.
	Width param.Opt[int64] `query:"width,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.

func (WebScreenshotParamsViewport) URLQuery

func (r WebScreenshotParamsViewport) URLQuery() (v url.Values, err error)

URLQuery serializes WebScreenshotParamsViewport's query parameters as `url.Values`.

type WebScreenshotParamsZdr added in v2.5.0

type WebScreenshotParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	WebScreenshotParamsZdrEnabled  WebScreenshotParamsZdr = "enabled"
	WebScreenshotParamsZdrDisabled WebScreenshotParamsZdr = "disabled"
)

type WebScreenshotResponse

type WebScreenshotResponse struct {
	// HTTP status code
	Code int64 `json:"code"`
	// The normalized domain that was processed
	Domain string `json:"domain"`
	// Height in pixels of the returned screenshot image
	Height int64 `json:"height"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebScreenshotResponseKeyMetadata `json:"key_metadata"`
	// Public image URL for standard requests, or an in-memory data URL when ZDR is
	// enabled.
	Screenshot string `json:"screenshot"`
	// Type of screenshot that was captured
	//
	// Any of "viewport", "fullPage".
	ScreenshotType WebScreenshotResponseScreenshotType `json:"screenshotType"`
	// Status of the response, e.g., 'ok'
	Status string `json:"status"`
	// Width in pixels of the returned screenshot image
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code           respjson.Field
		Domain         respjson.Field
		Height         respjson.Field
		KeyMetadata    respjson.Field
		Screenshot     respjson.Field
		ScreenshotType respjson.Field
		Status         respjson.Field
		Width          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScreenshotResponse) RawJSON

func (r WebScreenshotResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScreenshotResponse) UnmarshalJSON

func (r *WebScreenshotResponse) UnmarshalJSON(data []byte) error

type WebScreenshotResponseKeyMetadata

type WebScreenshotResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebScreenshotResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebScreenshotResponseKeyMetadata) UnmarshalJSON

func (r *WebScreenshotResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebScreenshotResponseScreenshotType

type WebScreenshotResponseScreenshotType string

Type of screenshot that was captured

const (
	WebScreenshotResponseScreenshotTypeViewport WebScreenshotResponseScreenshotType = "viewport"
	WebScreenshotResponseScreenshotTypeFullPage WebScreenshotResponseScreenshotType = "fullPage"
)

type WebSearchParams

type WebSearchParams struct {
	// Search query. Accepts natural language as well as Google-style search operators
	// such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
	Query string `json:"query" api:"required"`
	// Number of results to request and return (10–100). Defaults to 10.
	NumResults param.Opt[int64] `json:"numResults,omitzero"`
	// Expand the query into multiple parallel variants for broader recall.
	QueryFanout param.Opt[bool] `json:"queryFanout,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
	// country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
	//
	// Any of "af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw",
	// "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt",
	// "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca",
	// "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "cd", "ck",
	// "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "ec", "eg", "sv",
	// "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "gf", "pf", "tf", "ga",
	// "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw",
	// "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie",
	// "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la",
	// "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my",
	// "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn",
	// "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne",
	// "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "ps", "pa", "pg", "py", "pe",
	// "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "sh", "kn", "lc",
	// "pm", "vc", "ws", "sm", "st", "sa", "sn", "rs", "sc", "sl", "sg", "sk", "si",
	// "sb", "so", "za", "gs", "es", "lk", "sd", "sr", "sj", "sz", "se", "ch", "sy",
	// "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc",
	// "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "ve", "vn", "vg",
	// "vi", "wf", "eh", "ye", "zm", "zw".
	Country WebSearchParamsCountry `json:"country,omitzero"`
	// Blocklist — drop results from these domains. Example: ["pinterest.com",
	// "reddit.com"].
	ExcludeDomains []string `json:"excludeDomains,omitzero"`
	// Restrict results to content published within this window.
	//
	// Any of "last_24_hours", "last_week", "last_month", "last_year".
	Freshness WebSearchParamsFreshness `json:"freshness,omitzero"`
	// Allowlist — only return results from these domains. Example: ["arxiv.org",
	// "github.com"].
	IncludeDomains []string `json:"includeDomains,omitzero"`
	// Inline Markdown scraping for each result. Set `enabled: true` to activate.
	MarkdownOptions WebSearchParamsMarkdownOptions `json:"markdownOptions,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (WebSearchParams) MarshalJSON

func (r WebSearchParams) MarshalJSON() (data []byte, err error)

func (*WebSearchParams) UnmarshalJSON

func (r *WebSearchParams) UnmarshalJSON(data []byte) error

type WebSearchParamsCountry

type WebSearchParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: "us", "gb", "de".

const (
	WebSearchParamsCountryAf WebSearchParamsCountry = "af"
	WebSearchParamsCountryAl WebSearchParamsCountry = "al"
	WebSearchParamsCountryDz WebSearchParamsCountry = "dz"
	WebSearchParamsCountryAs WebSearchParamsCountry = "as"
	WebSearchParamsCountryAd WebSearchParamsCountry = "ad"
	WebSearchParamsCountryAo WebSearchParamsCountry = "ao"
	WebSearchParamsCountryAI WebSearchParamsCountry = "ai"
	WebSearchParamsCountryAq WebSearchParamsCountry = "aq"
	WebSearchParamsCountryAg WebSearchParamsCountry = "ag"
	WebSearchParamsCountryAr WebSearchParamsCountry = "ar"
	WebSearchParamsCountryAm WebSearchParamsCountry = "am"
	WebSearchParamsCountryAw WebSearchParamsCountry = "aw"
	WebSearchParamsCountryAu WebSearchParamsCountry = "au"
	WebSearchParamsCountryAt WebSearchParamsCountry = "at"
	WebSearchParamsCountryAz WebSearchParamsCountry = "az"
	WebSearchParamsCountryBs WebSearchParamsCountry = "bs"
	WebSearchParamsCountryBh WebSearchParamsCountry = "bh"
	WebSearchParamsCountryBd WebSearchParamsCountry = "bd"
	WebSearchParamsCountryBb WebSearchParamsCountry = "bb"
	WebSearchParamsCountryBy WebSearchParamsCountry = "by"
	WebSearchParamsCountryBe WebSearchParamsCountry = "be"
	WebSearchParamsCountryBz WebSearchParamsCountry = "bz"
	WebSearchParamsCountryBj WebSearchParamsCountry = "bj"
	WebSearchParamsCountryBm WebSearchParamsCountry = "bm"
	WebSearchParamsCountryBt WebSearchParamsCountry = "bt"
	WebSearchParamsCountryBo WebSearchParamsCountry = "bo"
	WebSearchParamsCountryBa WebSearchParamsCountry = "ba"
	WebSearchParamsCountryBw WebSearchParamsCountry = "bw"
	WebSearchParamsCountryBv WebSearchParamsCountry = "bv"
	WebSearchParamsCountryBr WebSearchParamsCountry = "br"
	WebSearchParamsCountryIo WebSearchParamsCountry = "io"
	WebSearchParamsCountryBn WebSearchParamsCountry = "bn"
	WebSearchParamsCountryBg WebSearchParamsCountry = "bg"
	WebSearchParamsCountryBf WebSearchParamsCountry = "bf"
	WebSearchParamsCountryBi WebSearchParamsCountry = "bi"
	WebSearchParamsCountryKh WebSearchParamsCountry = "kh"
	WebSearchParamsCountryCm WebSearchParamsCountry = "cm"
	WebSearchParamsCountryCa WebSearchParamsCountry = "ca"
	WebSearchParamsCountryCv WebSearchParamsCountry = "cv"
	WebSearchParamsCountryKy WebSearchParamsCountry = "ky"
	WebSearchParamsCountryCf WebSearchParamsCountry = "cf"
	WebSearchParamsCountryTd WebSearchParamsCountry = "td"
	WebSearchParamsCountryCl WebSearchParamsCountry = "cl"
	WebSearchParamsCountryCn WebSearchParamsCountry = "cn"
	WebSearchParamsCountryCx WebSearchParamsCountry = "cx"
	WebSearchParamsCountryCc WebSearchParamsCountry = "cc"
	WebSearchParamsCountryCo WebSearchParamsCountry = "co"
	WebSearchParamsCountryKm WebSearchParamsCountry = "km"
	WebSearchParamsCountryCg WebSearchParamsCountry = "cg"
	WebSearchParamsCountryCd WebSearchParamsCountry = "cd"
	WebSearchParamsCountryCk WebSearchParamsCountry = "ck"
	WebSearchParamsCountryCr WebSearchParamsCountry = "cr"
	WebSearchParamsCountryCi WebSearchParamsCountry = "ci"
	WebSearchParamsCountryHr WebSearchParamsCountry = "hr"
	WebSearchParamsCountryCu WebSearchParamsCountry = "cu"
	WebSearchParamsCountryCy WebSearchParamsCountry = "cy"
	WebSearchParamsCountryCz WebSearchParamsCountry = "cz"
	WebSearchParamsCountryDk WebSearchParamsCountry = "dk"
	WebSearchParamsCountryDj WebSearchParamsCountry = "dj"
	WebSearchParamsCountryDm WebSearchParamsCountry = "dm"
	WebSearchParamsCountryDo WebSearchParamsCountry = "do"
	WebSearchParamsCountryEc WebSearchParamsCountry = "ec"
	WebSearchParamsCountryEg WebSearchParamsCountry = "eg"
	WebSearchParamsCountrySv WebSearchParamsCountry = "sv"
	WebSearchParamsCountryGq WebSearchParamsCountry = "gq"
	WebSearchParamsCountryEr WebSearchParamsCountry = "er"
	WebSearchParamsCountryEe WebSearchParamsCountry = "ee"
	WebSearchParamsCountryEt WebSearchParamsCountry = "et"
	WebSearchParamsCountryFk WebSearchParamsCountry = "fk"
	WebSearchParamsCountryFo WebSearchParamsCountry = "fo"
	WebSearchParamsCountryFj WebSearchParamsCountry = "fj"
	WebSearchParamsCountryFi WebSearchParamsCountry = "fi"
	WebSearchParamsCountryFr WebSearchParamsCountry = "fr"
	WebSearchParamsCountryGf WebSearchParamsCountry = "gf"
	WebSearchParamsCountryPf WebSearchParamsCountry = "pf"
	WebSearchParamsCountryTf WebSearchParamsCountry = "tf"
	WebSearchParamsCountryGa WebSearchParamsCountry = "ga"
	WebSearchParamsCountryGm WebSearchParamsCountry = "gm"
	WebSearchParamsCountryGe WebSearchParamsCountry = "ge"
	WebSearchParamsCountryDe WebSearchParamsCountry = "de"
	WebSearchParamsCountryGh WebSearchParamsCountry = "gh"
	WebSearchParamsCountryGi WebSearchParamsCountry = "gi"
	WebSearchParamsCountryGr WebSearchParamsCountry = "gr"
	WebSearchParamsCountryGl WebSearchParamsCountry = "gl"
	WebSearchParamsCountryGd WebSearchParamsCountry = "gd"
	WebSearchParamsCountryGp WebSearchParamsCountry = "gp"
	WebSearchParamsCountryGu WebSearchParamsCountry = "gu"
	WebSearchParamsCountryGt WebSearchParamsCountry = "gt"
	WebSearchParamsCountryGn WebSearchParamsCountry = "gn"
	WebSearchParamsCountryGw WebSearchParamsCountry = "gw"
	WebSearchParamsCountryGy WebSearchParamsCountry = "gy"
	WebSearchParamsCountryHt WebSearchParamsCountry = "ht"
	WebSearchParamsCountryHm WebSearchParamsCountry = "hm"
	WebSearchParamsCountryVa WebSearchParamsCountry = "va"
	WebSearchParamsCountryHn WebSearchParamsCountry = "hn"
	WebSearchParamsCountryHk WebSearchParamsCountry = "hk"
	WebSearchParamsCountryHu WebSearchParamsCountry = "hu"
	WebSearchParamsCountryIs WebSearchParamsCountry = "is"
	WebSearchParamsCountryIn WebSearchParamsCountry = "in"
	WebSearchParamsCountryID WebSearchParamsCountry = "id"
	WebSearchParamsCountryIr WebSearchParamsCountry = "ir"
	WebSearchParamsCountryIq WebSearchParamsCountry = "iq"
	WebSearchParamsCountryIe WebSearchParamsCountry = "ie"
	WebSearchParamsCountryIl WebSearchParamsCountry = "il"
	WebSearchParamsCountryIt WebSearchParamsCountry = "it"
	WebSearchParamsCountryJm WebSearchParamsCountry = "jm"
	WebSearchParamsCountryJp WebSearchParamsCountry = "jp"
	WebSearchParamsCountryJo WebSearchParamsCountry = "jo"
	WebSearchParamsCountryKz WebSearchParamsCountry = "kz"
	WebSearchParamsCountryKe WebSearchParamsCountry = "ke"
	WebSearchParamsCountryKi WebSearchParamsCountry = "ki"
	WebSearchParamsCountryKp WebSearchParamsCountry = "kp"
	WebSearchParamsCountryKr WebSearchParamsCountry = "kr"
	WebSearchParamsCountryKw WebSearchParamsCountry = "kw"
	WebSearchParamsCountryKg WebSearchParamsCountry = "kg"
	WebSearchParamsCountryLa WebSearchParamsCountry = "la"
	WebSearchParamsCountryLv WebSearchParamsCountry = "lv"
	WebSearchParamsCountryLb WebSearchParamsCountry = "lb"
	WebSearchParamsCountryLs WebSearchParamsCountry = "ls"
	WebSearchParamsCountryLr WebSearchParamsCountry = "lr"
	WebSearchParamsCountryLy WebSearchParamsCountry = "ly"
	WebSearchParamsCountryLi WebSearchParamsCountry = "li"
	WebSearchParamsCountryLt WebSearchParamsCountry = "lt"
	WebSearchParamsCountryLu WebSearchParamsCountry = "lu"
	WebSearchParamsCountryMo WebSearchParamsCountry = "mo"
	WebSearchParamsCountryMk WebSearchParamsCountry = "mk"
	WebSearchParamsCountryMg WebSearchParamsCountry = "mg"
	WebSearchParamsCountryMw WebSearchParamsCountry = "mw"
	WebSearchParamsCountryMy WebSearchParamsCountry = "my"
	WebSearchParamsCountryMv WebSearchParamsCountry = "mv"
	WebSearchParamsCountryMl WebSearchParamsCountry = "ml"
	WebSearchParamsCountryMt WebSearchParamsCountry = "mt"
	WebSearchParamsCountryMh WebSearchParamsCountry = "mh"
	WebSearchParamsCountryMq WebSearchParamsCountry = "mq"
	WebSearchParamsCountryMr WebSearchParamsCountry = "mr"
	WebSearchParamsCountryMu WebSearchParamsCountry = "mu"
	WebSearchParamsCountryYt WebSearchParamsCountry = "yt"
	WebSearchParamsCountryMx WebSearchParamsCountry = "mx"
	WebSearchParamsCountryFm WebSearchParamsCountry = "fm"
	WebSearchParamsCountryMd WebSearchParamsCountry = "md"
	WebSearchParamsCountryMc WebSearchParamsCountry = "mc"
	WebSearchParamsCountryMn WebSearchParamsCountry = "mn"
	WebSearchParamsCountryMs WebSearchParamsCountry = "ms"
	WebSearchParamsCountryMa WebSearchParamsCountry = "ma"
	WebSearchParamsCountryMz WebSearchParamsCountry = "mz"
	WebSearchParamsCountryMm WebSearchParamsCountry = "mm"
	WebSearchParamsCountryNa WebSearchParamsCountry = "na"
	WebSearchParamsCountryNr WebSearchParamsCountry = "nr"
	WebSearchParamsCountryNp WebSearchParamsCountry = "np"
	WebSearchParamsCountryNl WebSearchParamsCountry = "nl"
	WebSearchParamsCountryAn WebSearchParamsCountry = "an"
	WebSearchParamsCountryNc WebSearchParamsCountry = "nc"
	WebSearchParamsCountryNz WebSearchParamsCountry = "nz"
	WebSearchParamsCountryNi WebSearchParamsCountry = "ni"
	WebSearchParamsCountryNe WebSearchParamsCountry = "ne"
	WebSearchParamsCountryNg WebSearchParamsCountry = "ng"
	WebSearchParamsCountryNu WebSearchParamsCountry = "nu"
	WebSearchParamsCountryNf WebSearchParamsCountry = "nf"
	WebSearchParamsCountryMp WebSearchParamsCountry = "mp"
	WebSearchParamsCountryNo WebSearchParamsCountry = "no"
	WebSearchParamsCountryOm WebSearchParamsCountry = "om"
	WebSearchParamsCountryPk WebSearchParamsCountry = "pk"
	WebSearchParamsCountryPw WebSearchParamsCountry = "pw"
	WebSearchParamsCountryPs WebSearchParamsCountry = "ps"
	WebSearchParamsCountryPa WebSearchParamsCountry = "pa"
	WebSearchParamsCountryPg WebSearchParamsCountry = "pg"
	WebSearchParamsCountryPy WebSearchParamsCountry = "py"
	WebSearchParamsCountryPe WebSearchParamsCountry = "pe"
	WebSearchParamsCountryPh WebSearchParamsCountry = "ph"
	WebSearchParamsCountryPn WebSearchParamsCountry = "pn"
	WebSearchParamsCountryPl WebSearchParamsCountry = "pl"
	WebSearchParamsCountryPt WebSearchParamsCountry = "pt"
	WebSearchParamsCountryPr WebSearchParamsCountry = "pr"
	WebSearchParamsCountryQa WebSearchParamsCountry = "qa"
	WebSearchParamsCountryRe WebSearchParamsCountry = "re"
	WebSearchParamsCountryRo WebSearchParamsCountry = "ro"
	WebSearchParamsCountryRu WebSearchParamsCountry = "ru"
	WebSearchParamsCountryRw WebSearchParamsCountry = "rw"
	WebSearchParamsCountrySh WebSearchParamsCountry = "sh"
	WebSearchParamsCountryKn WebSearchParamsCountry = "kn"
	WebSearchParamsCountryLc WebSearchParamsCountry = "lc"
	WebSearchParamsCountryPm WebSearchParamsCountry = "pm"
	WebSearchParamsCountryVc WebSearchParamsCountry = "vc"
	WebSearchParamsCountryWs WebSearchParamsCountry = "ws"
	WebSearchParamsCountrySm WebSearchParamsCountry = "sm"
	WebSearchParamsCountrySt WebSearchParamsCountry = "st"
	WebSearchParamsCountrySa WebSearchParamsCountry = "sa"
	WebSearchParamsCountrySn WebSearchParamsCountry = "sn"
	WebSearchParamsCountryRs WebSearchParamsCountry = "rs"
	WebSearchParamsCountrySc WebSearchParamsCountry = "sc"
	WebSearchParamsCountrySl WebSearchParamsCountry = "sl"
	WebSearchParamsCountrySg WebSearchParamsCountry = "sg"
	WebSearchParamsCountrySk WebSearchParamsCountry = "sk"
	WebSearchParamsCountrySi WebSearchParamsCountry = "si"
	WebSearchParamsCountrySb WebSearchParamsCountry = "sb"
	WebSearchParamsCountrySo WebSearchParamsCountry = "so"
	WebSearchParamsCountryZa WebSearchParamsCountry = "za"
	WebSearchParamsCountryGs WebSearchParamsCountry = "gs"
	WebSearchParamsCountryEs WebSearchParamsCountry = "es"
	WebSearchParamsCountryLk WebSearchParamsCountry = "lk"
	WebSearchParamsCountrySd WebSearchParamsCountry = "sd"
	WebSearchParamsCountrySr WebSearchParamsCountry = "sr"
	WebSearchParamsCountrySj WebSearchParamsCountry = "sj"
	WebSearchParamsCountrySz WebSearchParamsCountry = "sz"
	WebSearchParamsCountrySe WebSearchParamsCountry = "se"
	WebSearchParamsCountryCh WebSearchParamsCountry = "ch"
	WebSearchParamsCountrySy WebSearchParamsCountry = "sy"
	WebSearchParamsCountryTw WebSearchParamsCountry = "tw"
	WebSearchParamsCountryTj WebSearchParamsCountry = "tj"
	WebSearchParamsCountryTz WebSearchParamsCountry = "tz"
	WebSearchParamsCountryTh WebSearchParamsCountry = "th"
	WebSearchParamsCountryTl WebSearchParamsCountry = "tl"
	WebSearchParamsCountryTg WebSearchParamsCountry = "tg"
	WebSearchParamsCountryTk WebSearchParamsCountry = "tk"
	WebSearchParamsCountryTo WebSearchParamsCountry = "to"
	WebSearchParamsCountryTt WebSearchParamsCountry = "tt"
	WebSearchParamsCountryTn WebSearchParamsCountry = "tn"
	WebSearchParamsCountryTr WebSearchParamsCountry = "tr"
	WebSearchParamsCountryTm WebSearchParamsCountry = "tm"
	WebSearchParamsCountryTc WebSearchParamsCountry = "tc"
	WebSearchParamsCountryTv WebSearchParamsCountry = "tv"
	WebSearchParamsCountryUg WebSearchParamsCountry = "ug"
	WebSearchParamsCountryUa WebSearchParamsCountry = "ua"
	WebSearchParamsCountryAe WebSearchParamsCountry = "ae"
	WebSearchParamsCountryGB WebSearchParamsCountry = "gb"
	WebSearchParamsCountryUs WebSearchParamsCountry = "us"
	WebSearchParamsCountryUm WebSearchParamsCountry = "um"
	WebSearchParamsCountryUy WebSearchParamsCountry = "uy"
	WebSearchParamsCountryUz WebSearchParamsCountry = "uz"
	WebSearchParamsCountryVu WebSearchParamsCountry = "vu"
	WebSearchParamsCountryVe WebSearchParamsCountry = "ve"
	WebSearchParamsCountryVn WebSearchParamsCountry = "vn"
	WebSearchParamsCountryVg WebSearchParamsCountry = "vg"
	WebSearchParamsCountryVi WebSearchParamsCountry = "vi"
	WebSearchParamsCountryWf WebSearchParamsCountry = "wf"
	WebSearchParamsCountryEh WebSearchParamsCountry = "eh"
	WebSearchParamsCountryYe WebSearchParamsCountry = "ye"
	WebSearchParamsCountryZm WebSearchParamsCountry = "zm"
	WebSearchParamsCountryZw WebSearchParamsCountry = "zw"
)

type WebSearchParamsFreshness

type WebSearchParamsFreshness string

Restrict results to content published within this window.

const (
	WebSearchParamsFreshnessLast24Hours WebSearchParamsFreshness = "last_24_hours"
	WebSearchParamsFreshnessLastWeek    WebSearchParamsFreshness = "last_week"
	WebSearchParamsFreshnessLastMonth   WebSearchParamsFreshness = "last_month"
	WebSearchParamsFreshnessLastYear    WebSearchParamsFreshness = "last_year"
)

type WebSearchParamsMarkdownOptions

type WebSearchParamsMarkdownOptions struct {
	// Scrape each result to Markdown. Off by default to keep search cheap and fast.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Render iframe contents into the Markdown.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Emit image references in the Markdown.
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Keep hyperlinks in the Markdown.
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Cache TTL in ms for scraped Markdown keyed by URL + options. Default 1 day, max
	// 30 days. Set to 0 to force a fresh scrape.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Truncate inline base64 image payloads to keep responses small.
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Strip nav, header, footer, and sidebar — keep only the primary article content.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// Extra wait after page load before rendering, in ms (0–30000). Useful for
	// JS-heavy pages.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// PDF handling. Use start/end to bound text extraction and OCR to a page range.
	Pdf WebSearchParamsMarkdownOptionsPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Inline Markdown scraping for each result. Set `enabled: true` to activate.

func (WebSearchParamsMarkdownOptions) MarshalJSON

func (r WebSearchParamsMarkdownOptions) MarshalJSON() (data []byte, err error)

func (*WebSearchParamsMarkdownOptions) UnmarshalJSON

func (r *WebSearchParamsMarkdownOptions) UnmarshalJSON(data []byte) error

type WebSearchParamsMarkdownOptionsPdf

type WebSearchParamsMarkdownOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First PDF page to parse (1-based, inclusive). Defaults to page 1.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. Use start/end to bound text extraction and OCR to a page range.

func (WebSearchParamsMarkdownOptionsPdf) MarshalJSON

func (r WebSearchParamsMarkdownOptionsPdf) MarshalJSON() (data []byte, err error)

func (*WebSearchParamsMarkdownOptionsPdf) UnmarshalJSON

func (r *WebSearchParamsMarkdownOptionsPdf) UnmarshalJSON(data []byte) error

type WebSearchResponse

type WebSearchResponse struct {
	// Echo of the original query (useful when fanout was enabled).
	Query   string                    `json:"query" api:"required"`
	Results []WebSearchResponseResult `json:"results" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebSearchResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Query       respjson.Field
		Results     respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchResponse) RawJSON

func (r WebSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebSearchResponse) UnmarshalJSON

func (r *WebSearchResponse) UnmarshalJSON(data []byte) error

type WebSearchResponseKeyMetadata

type WebSearchResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebSearchResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebSearchResponseKeyMetadata) UnmarshalJSON

func (r *WebSearchResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebSearchResponseResult

type WebSearchResponseResult struct {
	// Snippet excerpt from the page.
	Description string `json:"description" api:"required"`
	// Markdown scrape status and content for this result.
	Markdown WebSearchResponseResultMarkdown `json:"markdown" api:"required"`
	// Relevance to the original query.
	//
	// Any of "high", "medium", "low".
	Relevance string `json:"relevance" api:"required"`
	// Page title.
	Title string `json:"title" api:"required"`
	// Canonical result URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		Markdown    respjson.Field
		Relevance   respjson.Field
		Title       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchResponseResult) RawJSON

func (r WebSearchResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebSearchResponseResult) UnmarshalJSON

func (r *WebSearchResponseResult) UnmarshalJSON(data []byte) error

type WebSearchResponseResultMarkdown

type WebSearchResponseResultMarkdown struct {
	// Per-result scrape outcome. Inspect this before reading `markdown`.
	//
	// Any of "SUCCESS", "NOT_REQUESTED", "TIMEOUT", "WEBSITE_ACCESS_ERROR", "ERROR".
	Code string `json:"code" api:"required"`
	// GFM Markdown of the page. Null unless markdownOptions.enabled is true and
	// scraping succeeded.
	Markdown string `json:"markdown" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Markdown    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Markdown scrape status and content for this result.

func (WebSearchResponseResultMarkdown) RawJSON

Returns the unmodified JSON received from the API

func (*WebSearchResponseResultMarkdown) UnmarshalJSON

func (r *WebSearchResponseResultMarkdown) UnmarshalJSON(data []byte) error

type WebService

type WebService struct {
	// contains filtered or unexported fields
}

WebService contains methods and other services that help with interacting with the context.dev API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebService method instead.

func NewWebService

func NewWebService(opts ...option.RequestOption) (r WebService)

NewWebService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WebService) Extract

func (r *WebService) Extract(ctx context.Context, body WebExtractParams, opts ...option.RequestOption) (res *WebExtractResponse, err error)

Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.

func (*WebService) ExtractCompetitors

func (r *WebService) ExtractCompetitors(ctx context.Context, query WebExtractCompetitorsParams, opts ...option.RequestOption) (res *WebExtractCompetitorsResponse, err error)

Analyze a company's landing page and web search evidence to return direct competitors for the same product or market.

func (*WebService) ExtractFonts

func (r *WebService) ExtractFonts(ctx context.Context, query WebExtractFontsParams, opts ...option.RequestOption) (res *WebExtractFontsResponse, err error)

Scrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.

func (*WebService) ExtractStyleguide

func (r *WebService) ExtractStyleguide(ctx context.Context, query WebExtractStyleguideParams, opts ...option.RequestOption) (res *WebExtractStyleguideResponse, err error)

Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.

func (*WebService) Screenshot

func (r *WebService) Screenshot(ctx context.Context, query WebScreenshotParams, opts ...option.RequestOption) (res *WebScreenshotResponse, err error)

Capture a screenshot of a website.

func (*WebService) Search

func (r *WebService) Search(ctx context.Context, body WebSearchParams, opts ...option.RequestOption) (res *WebSearchResponse, err error)

Search the web and optionally scrape each result to Markdown in one round-trip.

func (*WebService) WebCrawlMd

func (r *WebService) WebCrawlMd(ctx context.Context, body WebWebCrawlMdParams, opts ...option.RequestOption) (res *WebWebCrawlMdResponse, err error)

Performs a crawl starting from a given URL, extracts page content as Markdown, and returns results for all crawled pages.

func (*WebService) WebScrapeHTML

func (r *WebService) WebScrapeHTML(ctx context.Context, query WebWebScrapeHTMLParams, opts ...option.RequestOption) (res *WebWebScrapeHTMLResponse, err error)

Scrapes the given URL and returns the raw HTML content of the page. The base request costs 1 credit; requests with browser actions cost 2 credits.

func (*WebService) WebScrapeImages

func (r *WebService) WebScrapeImages(ctx context.Context, query WebWebScrapeImagesParams, opts ...option.RequestOption) (res *WebWebScrapeImagesResponse, err error)

Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and embeds. The base request costs 1 credit, or 2 credits with browser actions. When enrichment is enabled, the entire call costs 5 credits, including requests that also use actions.

func (*WebService) WebScrapeMd

func (r *WebService) WebScrapeMd(ctx context.Context, query WebWebScrapeMdParams, opts ...option.RequestOption) (res *WebWebScrapeMdResponse, err error)

Scrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON responses from a recognized API key; use error_code to distinguish stable failure categories.

### Billing & errors

| HTTP status | Billed? | Meaning | | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- | | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing | | 400 | No | Invalid input, skipped PDF, or the page could not be scraped | | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | | 404 | No | Target page returned or fingerprinted as not found | | 408 | No | Request timed out | | 415 | No | Unsupported content type | | 429 | No | Per-minute rate limit exceeded; honor Retry-After | | 500 | No | Internal error |

func (*WebService) WebScrapeSitemap

func (r *WebService) WebScrapeSitemap(ctx context.Context, query WebWebScrapeSitemapParams, opts ...option.RequestOption) (res *WebWebScrapeSitemapResponse, err error)

Crawl an entire website's sitemap and return all discovered page URLs.

type WebWebCrawlMdParams

type WebWebCrawlMdParams struct {
	// The starting URL for the crawl (must include http:// or https:// protocol)
	URL string `json:"url" api:"required" format:"uri"`
	// When true, follow links on subdomains of the starting URL's domain (e.g.
	// docs.example.com when starting from example.com). www and apex are always
	// treated as equivalent.
	FollowSubdomains param.Opt[bool] `json:"followSubdomains,omitzero"`
	// When true, the contents of iframes are rendered to Markdown for each crawled
	// page.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Include image references in the Markdown output
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Preserve hyperlinks in the Markdown output
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Maximum link depth from the starting URL (0 = only the starting page)
	MaxDepth param.Opt[int64] `json:"maxDepth,omitzero"`
	// Maximum number of pages to crawl. Hard cap: 500.
	MaxPages param.Opt[int64] `json:"maxPages,omitzero"`
	// When true, waits briefly for CSS and transition animations to settle before
	// extracting each crawled page. Defaults to false. This adds a bit of latency in
	// exchange for more stable output on animated pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Truncate base64-encoded image data in the Markdown output
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Soft time budget for the crawl in milliseconds. After each scrape, the crawler
	// checks the elapsed time and, if exceeded, returns the pages collected so far
	// instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000
	// (80s).
	StopAfterMs param.Opt[int64] `json:"stopAfterMs,omitzero"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"`
	// Regex pattern. Only URLs matching this pattern will be followed and scraped.
	URLRegex param.Opt[string] `json:"urlRegex,omitzero"`
	// Extract only the main content, stripping headers, footers, sidebars, and
	// navigation
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// Optional browser wait time in milliseconds after initial page load for each
	// crawled page. Min: 0. Max: 30000 (30 seconds).
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
	// residential proxy exit location. Must be one of Context.dev's supported
	// countries. When provided, Context.dev fetches the target page from that country.
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebWebCrawlMdParamsCountry `json:"country,omitzero"`
	// CSS selectors to remove before each crawled page is converted to Markdown.
	// Applied after includeSelectors. Exclusion takes precedence: an element matching
	// both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// CSS selectors. When provided, only matching HTML subtrees (and their
	// descendants) are kept before each crawled page is converted to Markdown. When
	// omitted, the entire document is kept. Examples: "article.main", "#content",
	// "[role=main]".
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// PDF parsing controls. Use start/end to limit text extraction and embedded-image
	// detection/OCR to an inclusive 1-based page range.
	Pdf WebWebCrawlMdParamsPdf `json:"pdf,omitzero"`
	// Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
	Tags []string `json:"tags,omitzero"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr WebWebCrawlMdParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (WebWebCrawlMdParams) MarshalJSON

func (r WebWebCrawlMdParams) MarshalJSON() (data []byte, err error)

func (*WebWebCrawlMdParams) UnmarshalJSON

func (r *WebWebCrawlMdParams) UnmarshalJSON(data []byte) error

type WebWebCrawlMdParamsCountry

type WebWebCrawlMdParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.

const (
	WebWebCrawlMdParamsCountryAd WebWebCrawlMdParamsCountry = "ad"
	WebWebCrawlMdParamsCountryAe WebWebCrawlMdParamsCountry = "ae"
	WebWebCrawlMdParamsCountryAf WebWebCrawlMdParamsCountry = "af"
	WebWebCrawlMdParamsCountryAg WebWebCrawlMdParamsCountry = "ag"
	WebWebCrawlMdParamsCountryAI WebWebCrawlMdParamsCountry = "ai"
	WebWebCrawlMdParamsCountryAl WebWebCrawlMdParamsCountry = "al"
	WebWebCrawlMdParamsCountryAm WebWebCrawlMdParamsCountry = "am"
	WebWebCrawlMdParamsCountryAo WebWebCrawlMdParamsCountry = "ao"
	WebWebCrawlMdParamsCountryAr WebWebCrawlMdParamsCountry = "ar"
	WebWebCrawlMdParamsCountryAt WebWebCrawlMdParamsCountry = "at"
	WebWebCrawlMdParamsCountryAu WebWebCrawlMdParamsCountry = "au"
	WebWebCrawlMdParamsCountryAw WebWebCrawlMdParamsCountry = "aw"
	WebWebCrawlMdParamsCountryAz WebWebCrawlMdParamsCountry = "az"
	WebWebCrawlMdParamsCountryBa WebWebCrawlMdParamsCountry = "ba"
	WebWebCrawlMdParamsCountryBb WebWebCrawlMdParamsCountry = "bb"
	WebWebCrawlMdParamsCountryBd WebWebCrawlMdParamsCountry = "bd"
	WebWebCrawlMdParamsCountryBe WebWebCrawlMdParamsCountry = "be"
	WebWebCrawlMdParamsCountryBf WebWebCrawlMdParamsCountry = "bf"
	WebWebCrawlMdParamsCountryBg WebWebCrawlMdParamsCountry = "bg"
	WebWebCrawlMdParamsCountryBh WebWebCrawlMdParamsCountry = "bh"
	WebWebCrawlMdParamsCountryBi WebWebCrawlMdParamsCountry = "bi"
	WebWebCrawlMdParamsCountryBj WebWebCrawlMdParamsCountry = "bj"
	WebWebCrawlMdParamsCountryBm WebWebCrawlMdParamsCountry = "bm"
	WebWebCrawlMdParamsCountryBn WebWebCrawlMdParamsCountry = "bn"
	WebWebCrawlMdParamsCountryBo WebWebCrawlMdParamsCountry = "bo"
	WebWebCrawlMdParamsCountryBq WebWebCrawlMdParamsCountry = "bq"
	WebWebCrawlMdParamsCountryBr WebWebCrawlMdParamsCountry = "br"
	WebWebCrawlMdParamsCountryBs WebWebCrawlMdParamsCountry = "bs"
	WebWebCrawlMdParamsCountryBw WebWebCrawlMdParamsCountry = "bw"
	WebWebCrawlMdParamsCountryBy WebWebCrawlMdParamsCountry = "by"
	WebWebCrawlMdParamsCountryBz WebWebCrawlMdParamsCountry = "bz"
	WebWebCrawlMdParamsCountryCa WebWebCrawlMdParamsCountry = "ca"
	WebWebCrawlMdParamsCountryCd WebWebCrawlMdParamsCountry = "cd"
	WebWebCrawlMdParamsCountryCf WebWebCrawlMdParamsCountry = "cf"
	WebWebCrawlMdParamsCountryCg WebWebCrawlMdParamsCountry = "cg"
	WebWebCrawlMdParamsCountryCh WebWebCrawlMdParamsCountry = "ch"
	WebWebCrawlMdParamsCountryCi WebWebCrawlMdParamsCountry = "ci"
	WebWebCrawlMdParamsCountryCl WebWebCrawlMdParamsCountry = "cl"
	WebWebCrawlMdParamsCountryCm WebWebCrawlMdParamsCountry = "cm"
	WebWebCrawlMdParamsCountryCn WebWebCrawlMdParamsCountry = "cn"
	WebWebCrawlMdParamsCountryCo WebWebCrawlMdParamsCountry = "co"
	WebWebCrawlMdParamsCountryCr WebWebCrawlMdParamsCountry = "cr"
	WebWebCrawlMdParamsCountryCv WebWebCrawlMdParamsCountry = "cv"
	WebWebCrawlMdParamsCountryCw WebWebCrawlMdParamsCountry = "cw"
	WebWebCrawlMdParamsCountryCy WebWebCrawlMdParamsCountry = "cy"
	WebWebCrawlMdParamsCountryCz WebWebCrawlMdParamsCountry = "cz"
	WebWebCrawlMdParamsCountryDe WebWebCrawlMdParamsCountry = "de"
	WebWebCrawlMdParamsCountryDj WebWebCrawlMdParamsCountry = "dj"
	WebWebCrawlMdParamsCountryDk WebWebCrawlMdParamsCountry = "dk"
	WebWebCrawlMdParamsCountryDm WebWebCrawlMdParamsCountry = "dm"
	WebWebCrawlMdParamsCountryDo WebWebCrawlMdParamsCountry = "do"
	WebWebCrawlMdParamsCountryDz WebWebCrawlMdParamsCountry = "dz"
	WebWebCrawlMdParamsCountryEc WebWebCrawlMdParamsCountry = "ec"
	WebWebCrawlMdParamsCountryEe WebWebCrawlMdParamsCountry = "ee"
	WebWebCrawlMdParamsCountryEg WebWebCrawlMdParamsCountry = "eg"
	WebWebCrawlMdParamsCountryEs WebWebCrawlMdParamsCountry = "es"
	WebWebCrawlMdParamsCountryEt WebWebCrawlMdParamsCountry = "et"
	WebWebCrawlMdParamsCountryFi WebWebCrawlMdParamsCountry = "fi"
	WebWebCrawlMdParamsCountryFj WebWebCrawlMdParamsCountry = "fj"
	WebWebCrawlMdParamsCountryFr WebWebCrawlMdParamsCountry = "fr"
	WebWebCrawlMdParamsCountryGa WebWebCrawlMdParamsCountry = "ga"
	WebWebCrawlMdParamsCountryGB WebWebCrawlMdParamsCountry = "gb"
	WebWebCrawlMdParamsCountryGd WebWebCrawlMdParamsCountry = "gd"
	WebWebCrawlMdParamsCountryGe WebWebCrawlMdParamsCountry = "ge"
	WebWebCrawlMdParamsCountryGf WebWebCrawlMdParamsCountry = "gf"
	WebWebCrawlMdParamsCountryGg WebWebCrawlMdParamsCountry = "gg"
	WebWebCrawlMdParamsCountryGh WebWebCrawlMdParamsCountry = "gh"
	WebWebCrawlMdParamsCountryGm WebWebCrawlMdParamsCountry = "gm"
	WebWebCrawlMdParamsCountryGn WebWebCrawlMdParamsCountry = "gn"
	WebWebCrawlMdParamsCountryGp WebWebCrawlMdParamsCountry = "gp"
	WebWebCrawlMdParamsCountryGq WebWebCrawlMdParamsCountry = "gq"
	WebWebCrawlMdParamsCountryGr WebWebCrawlMdParamsCountry = "gr"
	WebWebCrawlMdParamsCountryGt WebWebCrawlMdParamsCountry = "gt"
	WebWebCrawlMdParamsCountryGu WebWebCrawlMdParamsCountry = "gu"
	WebWebCrawlMdParamsCountryGw WebWebCrawlMdParamsCountry = "gw"
	WebWebCrawlMdParamsCountryGy WebWebCrawlMdParamsCountry = "gy"
	WebWebCrawlMdParamsCountryHk WebWebCrawlMdParamsCountry = "hk"
	WebWebCrawlMdParamsCountryHn WebWebCrawlMdParamsCountry = "hn"
	WebWebCrawlMdParamsCountryHr WebWebCrawlMdParamsCountry = "hr"
	WebWebCrawlMdParamsCountryHt WebWebCrawlMdParamsCountry = "ht"
	WebWebCrawlMdParamsCountryHu WebWebCrawlMdParamsCountry = "hu"
	WebWebCrawlMdParamsCountryID WebWebCrawlMdParamsCountry = "id"
	WebWebCrawlMdParamsCountryIe WebWebCrawlMdParamsCountry = "ie"
	WebWebCrawlMdParamsCountryIl WebWebCrawlMdParamsCountry = "il"
	WebWebCrawlMdParamsCountryIm WebWebCrawlMdParamsCountry = "im"
	WebWebCrawlMdParamsCountryIn WebWebCrawlMdParamsCountry = "in"
	WebWebCrawlMdParamsCountryIq WebWebCrawlMdParamsCountry = "iq"
	WebWebCrawlMdParamsCountryIr WebWebCrawlMdParamsCountry = "ir"
	WebWebCrawlMdParamsCountryIs WebWebCrawlMdParamsCountry = "is"
	WebWebCrawlMdParamsCountryIt WebWebCrawlMdParamsCountry = "it"
	WebWebCrawlMdParamsCountryJe WebWebCrawlMdParamsCountry = "je"
	WebWebCrawlMdParamsCountryJm WebWebCrawlMdParamsCountry = "jm"
	WebWebCrawlMdParamsCountryJo WebWebCrawlMdParamsCountry = "jo"
	WebWebCrawlMdParamsCountryJp WebWebCrawlMdParamsCountry = "jp"
	WebWebCrawlMdParamsCountryKe WebWebCrawlMdParamsCountry = "ke"
	WebWebCrawlMdParamsCountryKg WebWebCrawlMdParamsCountry = "kg"
	WebWebCrawlMdParamsCountryKh WebWebCrawlMdParamsCountry = "kh"
	WebWebCrawlMdParamsCountryKn WebWebCrawlMdParamsCountry = "kn"
	WebWebCrawlMdParamsCountryKr WebWebCrawlMdParamsCountry = "kr"
	WebWebCrawlMdParamsCountryKw WebWebCrawlMdParamsCountry = "kw"
	WebWebCrawlMdParamsCountryKy WebWebCrawlMdParamsCountry = "ky"
	WebWebCrawlMdParamsCountryKz WebWebCrawlMdParamsCountry = "kz"
	WebWebCrawlMdParamsCountryLa WebWebCrawlMdParamsCountry = "la"
	WebWebCrawlMdParamsCountryLb WebWebCrawlMdParamsCountry = "lb"
	WebWebCrawlMdParamsCountryLc WebWebCrawlMdParamsCountry = "lc"
	WebWebCrawlMdParamsCountryLk WebWebCrawlMdParamsCountry = "lk"
	WebWebCrawlMdParamsCountryLr WebWebCrawlMdParamsCountry = "lr"
	WebWebCrawlMdParamsCountryLs WebWebCrawlMdParamsCountry = "ls"
	WebWebCrawlMdParamsCountryLt WebWebCrawlMdParamsCountry = "lt"
	WebWebCrawlMdParamsCountryLu WebWebCrawlMdParamsCountry = "lu"
	WebWebCrawlMdParamsCountryLv WebWebCrawlMdParamsCountry = "lv"
	WebWebCrawlMdParamsCountryLy WebWebCrawlMdParamsCountry = "ly"
	WebWebCrawlMdParamsCountryMa WebWebCrawlMdParamsCountry = "ma"
	WebWebCrawlMdParamsCountryMc WebWebCrawlMdParamsCountry = "mc"
	WebWebCrawlMdParamsCountryMd WebWebCrawlMdParamsCountry = "md"
	WebWebCrawlMdParamsCountryMe WebWebCrawlMdParamsCountry = "me"
	WebWebCrawlMdParamsCountryMf WebWebCrawlMdParamsCountry = "mf"
	WebWebCrawlMdParamsCountryMg WebWebCrawlMdParamsCountry = "mg"
	WebWebCrawlMdParamsCountryMk WebWebCrawlMdParamsCountry = "mk"
	WebWebCrawlMdParamsCountryMl WebWebCrawlMdParamsCountry = "ml"
	WebWebCrawlMdParamsCountryMm WebWebCrawlMdParamsCountry = "mm"
	WebWebCrawlMdParamsCountryMn WebWebCrawlMdParamsCountry = "mn"
	WebWebCrawlMdParamsCountryMo WebWebCrawlMdParamsCountry = "mo"
	WebWebCrawlMdParamsCountryMq WebWebCrawlMdParamsCountry = "mq"
	WebWebCrawlMdParamsCountryMr WebWebCrawlMdParamsCountry = "mr"
	WebWebCrawlMdParamsCountryMt WebWebCrawlMdParamsCountry = "mt"
	WebWebCrawlMdParamsCountryMu WebWebCrawlMdParamsCountry = "mu"
	WebWebCrawlMdParamsCountryMv WebWebCrawlMdParamsCountry = "mv"
	WebWebCrawlMdParamsCountryMw WebWebCrawlMdParamsCountry = "mw"
	WebWebCrawlMdParamsCountryMx WebWebCrawlMdParamsCountry = "mx"
	WebWebCrawlMdParamsCountryMy WebWebCrawlMdParamsCountry = "my"
	WebWebCrawlMdParamsCountryMz WebWebCrawlMdParamsCountry = "mz"
	WebWebCrawlMdParamsCountryNa WebWebCrawlMdParamsCountry = "na"
	WebWebCrawlMdParamsCountryNc WebWebCrawlMdParamsCountry = "nc"
	WebWebCrawlMdParamsCountryNe WebWebCrawlMdParamsCountry = "ne"
	WebWebCrawlMdParamsCountryNg WebWebCrawlMdParamsCountry = "ng"
	WebWebCrawlMdParamsCountryNi WebWebCrawlMdParamsCountry = "ni"
	WebWebCrawlMdParamsCountryNl WebWebCrawlMdParamsCountry = "nl"
	WebWebCrawlMdParamsCountryNo WebWebCrawlMdParamsCountry = "no"
	WebWebCrawlMdParamsCountryNp WebWebCrawlMdParamsCountry = "np"
	WebWebCrawlMdParamsCountryNz WebWebCrawlMdParamsCountry = "nz"
	WebWebCrawlMdParamsCountryOm WebWebCrawlMdParamsCountry = "om"
	WebWebCrawlMdParamsCountryPa WebWebCrawlMdParamsCountry = "pa"
	WebWebCrawlMdParamsCountryPe WebWebCrawlMdParamsCountry = "pe"
	WebWebCrawlMdParamsCountryPf WebWebCrawlMdParamsCountry = "pf"
	WebWebCrawlMdParamsCountryPg WebWebCrawlMdParamsCountry = "pg"
	WebWebCrawlMdParamsCountryPh WebWebCrawlMdParamsCountry = "ph"
	WebWebCrawlMdParamsCountryPk WebWebCrawlMdParamsCountry = "pk"
	WebWebCrawlMdParamsCountryPl WebWebCrawlMdParamsCountry = "pl"
	WebWebCrawlMdParamsCountryPr WebWebCrawlMdParamsCountry = "pr"
	WebWebCrawlMdParamsCountryPs WebWebCrawlMdParamsCountry = "ps"
	WebWebCrawlMdParamsCountryPt WebWebCrawlMdParamsCountry = "pt"
	WebWebCrawlMdParamsCountryPy WebWebCrawlMdParamsCountry = "py"
	WebWebCrawlMdParamsCountryQa WebWebCrawlMdParamsCountry = "qa"
	WebWebCrawlMdParamsCountryRe WebWebCrawlMdParamsCountry = "re"
	WebWebCrawlMdParamsCountryRo WebWebCrawlMdParamsCountry = "ro"
	WebWebCrawlMdParamsCountryRs WebWebCrawlMdParamsCountry = "rs"
	WebWebCrawlMdParamsCountryRu WebWebCrawlMdParamsCountry = "ru"
	WebWebCrawlMdParamsCountryRw WebWebCrawlMdParamsCountry = "rw"
	WebWebCrawlMdParamsCountrySa WebWebCrawlMdParamsCountry = "sa"
	WebWebCrawlMdParamsCountrySc WebWebCrawlMdParamsCountry = "sc"
	WebWebCrawlMdParamsCountrySd WebWebCrawlMdParamsCountry = "sd"
	WebWebCrawlMdParamsCountrySe WebWebCrawlMdParamsCountry = "se"
	WebWebCrawlMdParamsCountrySg WebWebCrawlMdParamsCountry = "sg"
	WebWebCrawlMdParamsCountrySi WebWebCrawlMdParamsCountry = "si"
	WebWebCrawlMdParamsCountrySk WebWebCrawlMdParamsCountry = "sk"
	WebWebCrawlMdParamsCountrySl WebWebCrawlMdParamsCountry = "sl"
	WebWebCrawlMdParamsCountrySm WebWebCrawlMdParamsCountry = "sm"
	WebWebCrawlMdParamsCountrySn WebWebCrawlMdParamsCountry = "sn"
	WebWebCrawlMdParamsCountrySo WebWebCrawlMdParamsCountry = "so"
	WebWebCrawlMdParamsCountrySr WebWebCrawlMdParamsCountry = "sr"
	WebWebCrawlMdParamsCountrySS WebWebCrawlMdParamsCountry = "ss"
	WebWebCrawlMdParamsCountrySt WebWebCrawlMdParamsCountry = "st"
	WebWebCrawlMdParamsCountrySv WebWebCrawlMdParamsCountry = "sv"
	WebWebCrawlMdParamsCountrySx WebWebCrawlMdParamsCountry = "sx"
	WebWebCrawlMdParamsCountrySy WebWebCrawlMdParamsCountry = "sy"
	WebWebCrawlMdParamsCountrySz WebWebCrawlMdParamsCountry = "sz"
	WebWebCrawlMdParamsCountryTc WebWebCrawlMdParamsCountry = "tc"
	WebWebCrawlMdParamsCountryTd WebWebCrawlMdParamsCountry = "td"
	WebWebCrawlMdParamsCountryTg WebWebCrawlMdParamsCountry = "tg"
	WebWebCrawlMdParamsCountryTh WebWebCrawlMdParamsCountry = "th"
	WebWebCrawlMdParamsCountryTj WebWebCrawlMdParamsCountry = "tj"
	WebWebCrawlMdParamsCountryTl WebWebCrawlMdParamsCountry = "tl"
	WebWebCrawlMdParamsCountryTm WebWebCrawlMdParamsCountry = "tm"
	WebWebCrawlMdParamsCountryTn WebWebCrawlMdParamsCountry = "tn"
	WebWebCrawlMdParamsCountryTr WebWebCrawlMdParamsCountry = "tr"
	WebWebCrawlMdParamsCountryTt WebWebCrawlMdParamsCountry = "tt"
	WebWebCrawlMdParamsCountryTw WebWebCrawlMdParamsCountry = "tw"
	WebWebCrawlMdParamsCountryTz WebWebCrawlMdParamsCountry = "tz"
	WebWebCrawlMdParamsCountryUa WebWebCrawlMdParamsCountry = "ua"
	WebWebCrawlMdParamsCountryUg WebWebCrawlMdParamsCountry = "ug"
	WebWebCrawlMdParamsCountryUs WebWebCrawlMdParamsCountry = "us"
	WebWebCrawlMdParamsCountryUy WebWebCrawlMdParamsCountry = "uy"
	WebWebCrawlMdParamsCountryUz WebWebCrawlMdParamsCountry = "uz"
	WebWebCrawlMdParamsCountryVc WebWebCrawlMdParamsCountry = "vc"
	WebWebCrawlMdParamsCountryVe WebWebCrawlMdParamsCountry = "ve"
	WebWebCrawlMdParamsCountryVg WebWebCrawlMdParamsCountry = "vg"
	WebWebCrawlMdParamsCountryVi WebWebCrawlMdParamsCountry = "vi"
	WebWebCrawlMdParamsCountryVn WebWebCrawlMdParamsCountry = "vn"
	WebWebCrawlMdParamsCountryYe WebWebCrawlMdParamsCountry = "ye"
	WebWebCrawlMdParamsCountryYt WebWebCrawlMdParamsCountry = "yt"
	WebWebCrawlMdParamsCountryZa WebWebCrawlMdParamsCountry = "za"
	WebWebCrawlMdParamsCountryZm WebWebCrawlMdParamsCountry = "zm"
	WebWebCrawlMdParamsCountryZw WebWebCrawlMdParamsCountry = "zw"
)

type WebWebCrawlMdParamsPdf

type WebWebCrawlMdParamsPdf struct {
	// Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
	// Must be greater than or equal to start when both are provided.
	End param.Opt[int64] `json:"end,omitzero"`
	// When true, detect and OCR images embedded in the selected PDF pages, inserting
	// recognized text at each image's position in page reading order while preserving
	// the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// When true, PDF pages are fetched and parsed. When false, PDF pages are skipped
	// entirely (not included in results and not counted as failures).
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse. When omitted, parsing starts at the first page.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.

func (WebWebCrawlMdParamsPdf) MarshalJSON

func (r WebWebCrawlMdParamsPdf) MarshalJSON() (data []byte, err error)

func (*WebWebCrawlMdParamsPdf) UnmarshalJSON

func (r *WebWebCrawlMdParamsPdf) UnmarshalJSON(data []byte) error

type WebWebCrawlMdParamsZdr added in v2.5.0

type WebWebCrawlMdParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	WebWebCrawlMdParamsZdrEnabled  WebWebCrawlMdParamsZdr = "enabled"
	WebWebCrawlMdParamsZdrDisabled WebWebCrawlMdParamsZdr = "disabled"
)

type WebWebCrawlMdResponse

type WebWebCrawlMdResponse struct {
	Metadata WebWebCrawlMdResponseMetadata `json:"metadata" api:"required"`
	Results  []WebWebCrawlMdResponseResult `json:"results" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebWebCrawlMdResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Results     respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponse) RawJSON

func (r WebWebCrawlMdResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponse) UnmarshalJSON

func (r *WebWebCrawlMdResponse) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseKeyMetadata

type WebWebCrawlMdResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebWebCrawlMdResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseKeyMetadata) UnmarshalJSON

func (r *WebWebCrawlMdResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseMetadata

type WebWebCrawlMdResponseMetadata struct {
	// Maximum crawl depth reached during the crawl
	MaxCrawlDepth int64 `json:"maxCrawlDepth" api:"required"`
	// Number of pages that failed to crawl
	NumFailed int64 `json:"numFailed" api:"required"`
	// Number of URLs skipped (PDFs when pdf.shouldParse=false, or URLs not matching
	// urlRegex)
	NumSkipped int64 `json:"numSkipped" api:"required"`
	// Number of pages successfully crawled
	NumSucceeded int64 `json:"numSucceeded" api:"required"`
	// Total number of URLs crawled
	NumURLs int64 `json:"numUrls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxCrawlDepth respjson.Field
		NumFailed     respjson.Field
		NumSkipped    respjson.Field
		NumSucceeded  respjson.Field
		NumURLs       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseMetadata) UnmarshalJSON

func (r *WebWebCrawlMdResponseMetadata) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseResult

type WebWebCrawlMdResponseResult struct {
	// Extracted page content as Markdown (empty string on failure)
	Markdown string                              `json:"markdown" api:"required"`
	Metadata WebWebCrawlMdResponseResultMetadata `json:"metadata" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Markdown    respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResult) RawJSON

func (r WebWebCrawlMdResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResult) UnmarshalJSON

func (r *WebWebCrawlMdResponseResult) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseResultMetadata

type WebWebCrawlMdResponseResultMetadata struct {
	// Depth relative to the start URL. 0 = start URL, 1 = one link away.
	CrawlDepth int64 `json:"crawlDepth" api:"required"`
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// HTTP status code of the response
	StatusCode int64 `json:"statusCode" api:"required"`
	// true if the page was fetched and parsed successfully
	Success bool `json:"success" api:"required"`
	// Best page title extracted from the page (empty string if unavailable).
	Title string `json:"title" api:"required"`
	// The crawl URL fetched for this page.
	URL string `json:"url" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []WebWebCrawlMdResponseResultMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]WebWebCrawlMdResponseResultMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]WebWebCrawlMdResponseResultMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CrawlDepth     respjson.Field
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		StatusCode     respjson.Field
		Success        respjson.Field
		Title          respjson.Field
		URL            respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResultMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadata) UnmarshalJSON

func (r *WebWebCrawlMdResponseResultMetadata) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion

type WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsString

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) UnmarshalJSON

type WebWebCrawlMdResponseResultMetadataAlternate

type WebWebCrawlMdResponseResultMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResultMetadataAlternate) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataAlternate) UnmarshalJSON

func (r *WebWebCrawlMdResponseResultMetadataAlternate) UnmarshalJSON(data []byte) error

type WebWebCrawlMdResponseResultMetadataOpenGraphUnion

type WebWebCrawlMdResponseResultMetadataOpenGraphUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebCrawlMdResponseResultMetadataOpenGraphUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsString

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataOpenGraphUnion) UnmarshalJSON

type WebWebCrawlMdResponseResultMetadataTwitterUnion

type WebWebCrawlMdResponseResultMetadataTwitterUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebCrawlMdResponseResultMetadataTwitterUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) AsString

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataTwitterUnion) UnmarshalJSON

type WebWebScrapeHTMLParams

type WebWebScrapeHTMLParams struct {
	// Full URL to scrape (must include http:// or https:// protocol)
	URL string `query:"url" api:"required" format:"uri" json:"-"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
	// 30000 (30 seconds).
	WaitForMs param.Opt[int64] `query:"waitForMs,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional browser actions executed in array order after the page loads and before
	// content is captured. Requires a paid plan. Send a JSON array in the query
	// parameter. Maximum: 5 actions.
	Actions []WebWebScrapeHTMLParamsActionUnion `query:"actions,omitzero" json:"-"`
	// CSS selectors to remove from the result. Applied after includeSelectors.
	// Exclusion takes precedence: an element matching both is removed. Examples:
	// "nav", "footer", ".ad-banner", "[aria-hidden=true]".
	ExcludeSelectors []string `query:"excludeSelectors,omitzero" json:"-"`
	// CSS selectors. When provided, only matching subtrees (and their descendants) are
	// kept and everything else is dropped. When omitted, the entire document is kept.
	// Examples: "article.main", "#content", "[role=main]".
	IncludeSelectors []string `query:"includeSelectors,omitzero" json:"-"`
	// Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
	// residential proxy exit location. Must be one of Context.dev's supported
	// countries. When provided, Context.dev fetches the target page from that country.
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebWebScrapeHTMLParamsCountry `query:"country,omitzero" json:"-"`
	// Optional outbound HTTP headers forwarded only to the target URL, sent as
	// deep-object query params such as headers[X-Custom]=value. When provided, caching
	// is bypassed: the result is neither read from nor written to cache.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// When true, iframes are rendered inline into the returned HTML.
	IncludeFrames WebWebScrapeHTMLParamsIncludeFramesUnion `query:"includeFrames,omitzero" json:"-"`
	// PDF parsing controls. Use start/end to limit text extraction and embedded-image
	// detection/OCR to an inclusive 1-based page range.
	Pdf WebWebScrapeHTMLParamsPdf `query:"pdf,omitzero" json:"-"`
	// When true, waits briefly for CSS and transition animations to settle before
	// extracting HTML. Defaults to false. This adds a bit of latency in exchange for
	// more stable output on animated pages.
	SettleAnimations WebWebScrapeHTMLParamsSettleAnimationsUnion `query:"settleAnimations,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// When true, return only the page's main content in the HTML response, excluding
	// headers, footers, sidebars, and navigation when detectable.
	UseMainContentOnly WebWebScrapeHTMLParamsUseMainContentOnlyUnion `query:"useMainContentOnly,omitzero" json:"-"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr WebWebScrapeHTMLParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebWebScrapeHTMLParams) URLQuery

func (r WebWebScrapeHTMLParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeHTMLParams's query parameters as `url.Values`.

type WebWebScrapeHTMLParamsActionPerform added in v2.5.0

type WebWebScrapeHTMLParamsActionPerform struct {
	Action string `query:"action" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "perform".
	Do constant.Perform `query:"do" json:"-" default:"perform"`
	// contains filtered or unexported fields
}

Resolve and perform one natural-language browser action.

The properties Action, Do are required.

func (WebWebScrapeHTMLParamsActionPerform) URLQuery added in v2.5.0

func (r WebWebScrapeHTMLParamsActionPerform) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeHTMLParamsActionPerform's query parameters as `url.Values`.

type WebWebScrapeHTMLParamsActionUnion added in v2.5.0

type WebWebScrapeHTMLParamsActionUnion struct {
	OfWait    *WebWebScrapeHTMLParamsActionWait    `query:",omitzero,inline"`
	OfPerform *WebWebScrapeHTMLParamsActionPerform `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsActionWait added in v2.5.0

type WebWebScrapeHTMLParamsActionWait struct {
	TimeMs int64 `query:"timeMs" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "wait".
	Do constant.Wait `query:"do" json:"-" default:"wait"`
	// contains filtered or unexported fields
}

Pause for a fixed number of milliseconds before continuing to the next action.

The properties Do, TimeMs are required.

func (WebWebScrapeHTMLParamsActionWait) URLQuery added in v2.5.0

func (r WebWebScrapeHTMLParamsActionWait) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeHTMLParamsActionWait's query parameters as `url.Values`.

type WebWebScrapeHTMLParamsCountry

type WebWebScrapeHTMLParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.

const (
	WebWebScrapeHTMLParamsCountryAd WebWebScrapeHTMLParamsCountry = "ad"
	WebWebScrapeHTMLParamsCountryAe WebWebScrapeHTMLParamsCountry = "ae"
	WebWebScrapeHTMLParamsCountryAf WebWebScrapeHTMLParamsCountry = "af"
	WebWebScrapeHTMLParamsCountryAg WebWebScrapeHTMLParamsCountry = "ag"
	WebWebScrapeHTMLParamsCountryAI WebWebScrapeHTMLParamsCountry = "ai"
	WebWebScrapeHTMLParamsCountryAl WebWebScrapeHTMLParamsCountry = "al"
	WebWebScrapeHTMLParamsCountryAm WebWebScrapeHTMLParamsCountry = "am"
	WebWebScrapeHTMLParamsCountryAo WebWebScrapeHTMLParamsCountry = "ao"
	WebWebScrapeHTMLParamsCountryAr WebWebScrapeHTMLParamsCountry = "ar"
	WebWebScrapeHTMLParamsCountryAt WebWebScrapeHTMLParamsCountry = "at"
	WebWebScrapeHTMLParamsCountryAu WebWebScrapeHTMLParamsCountry = "au"
	WebWebScrapeHTMLParamsCountryAw WebWebScrapeHTMLParamsCountry = "aw"
	WebWebScrapeHTMLParamsCountryAz WebWebScrapeHTMLParamsCountry = "az"
	WebWebScrapeHTMLParamsCountryBa WebWebScrapeHTMLParamsCountry = "ba"
	WebWebScrapeHTMLParamsCountryBb WebWebScrapeHTMLParamsCountry = "bb"
	WebWebScrapeHTMLParamsCountryBd WebWebScrapeHTMLParamsCountry = "bd"
	WebWebScrapeHTMLParamsCountryBe WebWebScrapeHTMLParamsCountry = "be"
	WebWebScrapeHTMLParamsCountryBf WebWebScrapeHTMLParamsCountry = "bf"
	WebWebScrapeHTMLParamsCountryBg WebWebScrapeHTMLParamsCountry = "bg"
	WebWebScrapeHTMLParamsCountryBh WebWebScrapeHTMLParamsCountry = "bh"
	WebWebScrapeHTMLParamsCountryBi WebWebScrapeHTMLParamsCountry = "bi"
	WebWebScrapeHTMLParamsCountryBj WebWebScrapeHTMLParamsCountry = "bj"
	WebWebScrapeHTMLParamsCountryBm WebWebScrapeHTMLParamsCountry = "bm"
	WebWebScrapeHTMLParamsCountryBn WebWebScrapeHTMLParamsCountry = "bn"
	WebWebScrapeHTMLParamsCountryBo WebWebScrapeHTMLParamsCountry = "bo"
	WebWebScrapeHTMLParamsCountryBq WebWebScrapeHTMLParamsCountry = "bq"
	WebWebScrapeHTMLParamsCountryBr WebWebScrapeHTMLParamsCountry = "br"
	WebWebScrapeHTMLParamsCountryBs WebWebScrapeHTMLParamsCountry = "bs"
	WebWebScrapeHTMLParamsCountryBw WebWebScrapeHTMLParamsCountry = "bw"
	WebWebScrapeHTMLParamsCountryBy WebWebScrapeHTMLParamsCountry = "by"
	WebWebScrapeHTMLParamsCountryBz WebWebScrapeHTMLParamsCountry = "bz"
	WebWebScrapeHTMLParamsCountryCa WebWebScrapeHTMLParamsCountry = "ca"
	WebWebScrapeHTMLParamsCountryCd WebWebScrapeHTMLParamsCountry = "cd"
	WebWebScrapeHTMLParamsCountryCf WebWebScrapeHTMLParamsCountry = "cf"
	WebWebScrapeHTMLParamsCountryCg WebWebScrapeHTMLParamsCountry = "cg"
	WebWebScrapeHTMLParamsCountryCh WebWebScrapeHTMLParamsCountry = "ch"
	WebWebScrapeHTMLParamsCountryCi WebWebScrapeHTMLParamsCountry = "ci"
	WebWebScrapeHTMLParamsCountryCl WebWebScrapeHTMLParamsCountry = "cl"
	WebWebScrapeHTMLParamsCountryCm WebWebScrapeHTMLParamsCountry = "cm"
	WebWebScrapeHTMLParamsCountryCn WebWebScrapeHTMLParamsCountry = "cn"
	WebWebScrapeHTMLParamsCountryCo WebWebScrapeHTMLParamsCountry = "co"
	WebWebScrapeHTMLParamsCountryCr WebWebScrapeHTMLParamsCountry = "cr"
	WebWebScrapeHTMLParamsCountryCv WebWebScrapeHTMLParamsCountry = "cv"
	WebWebScrapeHTMLParamsCountryCw WebWebScrapeHTMLParamsCountry = "cw"
	WebWebScrapeHTMLParamsCountryCy WebWebScrapeHTMLParamsCountry = "cy"
	WebWebScrapeHTMLParamsCountryCz WebWebScrapeHTMLParamsCountry = "cz"
	WebWebScrapeHTMLParamsCountryDe WebWebScrapeHTMLParamsCountry = "de"
	WebWebScrapeHTMLParamsCountryDj WebWebScrapeHTMLParamsCountry = "dj"
	WebWebScrapeHTMLParamsCountryDk WebWebScrapeHTMLParamsCountry = "dk"
	WebWebScrapeHTMLParamsCountryDm WebWebScrapeHTMLParamsCountry = "dm"
	WebWebScrapeHTMLParamsCountryDo WebWebScrapeHTMLParamsCountry = "do"
	WebWebScrapeHTMLParamsCountryDz WebWebScrapeHTMLParamsCountry = "dz"
	WebWebScrapeHTMLParamsCountryEc WebWebScrapeHTMLParamsCountry = "ec"
	WebWebScrapeHTMLParamsCountryEe WebWebScrapeHTMLParamsCountry = "ee"
	WebWebScrapeHTMLParamsCountryEg WebWebScrapeHTMLParamsCountry = "eg"
	WebWebScrapeHTMLParamsCountryEs WebWebScrapeHTMLParamsCountry = "es"
	WebWebScrapeHTMLParamsCountryEt WebWebScrapeHTMLParamsCountry = "et"
	WebWebScrapeHTMLParamsCountryFi WebWebScrapeHTMLParamsCountry = "fi"
	WebWebScrapeHTMLParamsCountryFj WebWebScrapeHTMLParamsCountry = "fj"
	WebWebScrapeHTMLParamsCountryFr WebWebScrapeHTMLParamsCountry = "fr"
	WebWebScrapeHTMLParamsCountryGa WebWebScrapeHTMLParamsCountry = "ga"
	WebWebScrapeHTMLParamsCountryGB WebWebScrapeHTMLParamsCountry = "gb"
	WebWebScrapeHTMLParamsCountryGd WebWebScrapeHTMLParamsCountry = "gd"
	WebWebScrapeHTMLParamsCountryGe WebWebScrapeHTMLParamsCountry = "ge"
	WebWebScrapeHTMLParamsCountryGf WebWebScrapeHTMLParamsCountry = "gf"
	WebWebScrapeHTMLParamsCountryGg WebWebScrapeHTMLParamsCountry = "gg"
	WebWebScrapeHTMLParamsCountryGh WebWebScrapeHTMLParamsCountry = "gh"
	WebWebScrapeHTMLParamsCountryGm WebWebScrapeHTMLParamsCountry = "gm"
	WebWebScrapeHTMLParamsCountryGn WebWebScrapeHTMLParamsCountry = "gn"
	WebWebScrapeHTMLParamsCountryGp WebWebScrapeHTMLParamsCountry = "gp"
	WebWebScrapeHTMLParamsCountryGq WebWebScrapeHTMLParamsCountry = "gq"
	WebWebScrapeHTMLParamsCountryGr WebWebScrapeHTMLParamsCountry = "gr"
	WebWebScrapeHTMLParamsCountryGt WebWebScrapeHTMLParamsCountry = "gt"
	WebWebScrapeHTMLParamsCountryGu WebWebScrapeHTMLParamsCountry = "gu"
	WebWebScrapeHTMLParamsCountryGw WebWebScrapeHTMLParamsCountry = "gw"
	WebWebScrapeHTMLParamsCountryGy WebWebScrapeHTMLParamsCountry = "gy"
	WebWebScrapeHTMLParamsCountryHk WebWebScrapeHTMLParamsCountry = "hk"
	WebWebScrapeHTMLParamsCountryHn WebWebScrapeHTMLParamsCountry = "hn"
	WebWebScrapeHTMLParamsCountryHr WebWebScrapeHTMLParamsCountry = "hr"
	WebWebScrapeHTMLParamsCountryHt WebWebScrapeHTMLParamsCountry = "ht"
	WebWebScrapeHTMLParamsCountryHu WebWebScrapeHTMLParamsCountry = "hu"
	WebWebScrapeHTMLParamsCountryID WebWebScrapeHTMLParamsCountry = "id"
	WebWebScrapeHTMLParamsCountryIe WebWebScrapeHTMLParamsCountry = "ie"
	WebWebScrapeHTMLParamsCountryIl WebWebScrapeHTMLParamsCountry = "il"
	WebWebScrapeHTMLParamsCountryIm WebWebScrapeHTMLParamsCountry = "im"
	WebWebScrapeHTMLParamsCountryIn WebWebScrapeHTMLParamsCountry = "in"
	WebWebScrapeHTMLParamsCountryIq WebWebScrapeHTMLParamsCountry = "iq"
	WebWebScrapeHTMLParamsCountryIr WebWebScrapeHTMLParamsCountry = "ir"
	WebWebScrapeHTMLParamsCountryIs WebWebScrapeHTMLParamsCountry = "is"
	WebWebScrapeHTMLParamsCountryIt WebWebScrapeHTMLParamsCountry = "it"
	WebWebScrapeHTMLParamsCountryJe WebWebScrapeHTMLParamsCountry = "je"
	WebWebScrapeHTMLParamsCountryJm WebWebScrapeHTMLParamsCountry = "jm"
	WebWebScrapeHTMLParamsCountryJo WebWebScrapeHTMLParamsCountry = "jo"
	WebWebScrapeHTMLParamsCountryJp WebWebScrapeHTMLParamsCountry = "jp"
	WebWebScrapeHTMLParamsCountryKe WebWebScrapeHTMLParamsCountry = "ke"
	WebWebScrapeHTMLParamsCountryKg WebWebScrapeHTMLParamsCountry = "kg"
	WebWebScrapeHTMLParamsCountryKh WebWebScrapeHTMLParamsCountry = "kh"
	WebWebScrapeHTMLParamsCountryKn WebWebScrapeHTMLParamsCountry = "kn"
	WebWebScrapeHTMLParamsCountryKr WebWebScrapeHTMLParamsCountry = "kr"
	WebWebScrapeHTMLParamsCountryKw WebWebScrapeHTMLParamsCountry = "kw"
	WebWebScrapeHTMLParamsCountryKy WebWebScrapeHTMLParamsCountry = "ky"
	WebWebScrapeHTMLParamsCountryKz WebWebScrapeHTMLParamsCountry = "kz"
	WebWebScrapeHTMLParamsCountryLa WebWebScrapeHTMLParamsCountry = "la"
	WebWebScrapeHTMLParamsCountryLb WebWebScrapeHTMLParamsCountry = "lb"
	WebWebScrapeHTMLParamsCountryLc WebWebScrapeHTMLParamsCountry = "lc"
	WebWebScrapeHTMLParamsCountryLk WebWebScrapeHTMLParamsCountry = "lk"
	WebWebScrapeHTMLParamsCountryLr WebWebScrapeHTMLParamsCountry = "lr"
	WebWebScrapeHTMLParamsCountryLs WebWebScrapeHTMLParamsCountry = "ls"
	WebWebScrapeHTMLParamsCountryLt WebWebScrapeHTMLParamsCountry = "lt"
	WebWebScrapeHTMLParamsCountryLu WebWebScrapeHTMLParamsCountry = "lu"
	WebWebScrapeHTMLParamsCountryLv WebWebScrapeHTMLParamsCountry = "lv"
	WebWebScrapeHTMLParamsCountryLy WebWebScrapeHTMLParamsCountry = "ly"
	WebWebScrapeHTMLParamsCountryMa WebWebScrapeHTMLParamsCountry = "ma"
	WebWebScrapeHTMLParamsCountryMc WebWebScrapeHTMLParamsCountry = "mc"
	WebWebScrapeHTMLParamsCountryMd WebWebScrapeHTMLParamsCountry = "md"
	WebWebScrapeHTMLParamsCountryMe WebWebScrapeHTMLParamsCountry = "me"
	WebWebScrapeHTMLParamsCountryMf WebWebScrapeHTMLParamsCountry = "mf"
	WebWebScrapeHTMLParamsCountryMg WebWebScrapeHTMLParamsCountry = "mg"
	WebWebScrapeHTMLParamsCountryMk WebWebScrapeHTMLParamsCountry = "mk"
	WebWebScrapeHTMLParamsCountryMl WebWebScrapeHTMLParamsCountry = "ml"
	WebWebScrapeHTMLParamsCountryMm WebWebScrapeHTMLParamsCountry = "mm"
	WebWebScrapeHTMLParamsCountryMn WebWebScrapeHTMLParamsCountry = "mn"
	WebWebScrapeHTMLParamsCountryMo WebWebScrapeHTMLParamsCountry = "mo"
	WebWebScrapeHTMLParamsCountryMq WebWebScrapeHTMLParamsCountry = "mq"
	WebWebScrapeHTMLParamsCountryMr WebWebScrapeHTMLParamsCountry = "mr"
	WebWebScrapeHTMLParamsCountryMt WebWebScrapeHTMLParamsCountry = "mt"
	WebWebScrapeHTMLParamsCountryMu WebWebScrapeHTMLParamsCountry = "mu"
	WebWebScrapeHTMLParamsCountryMv WebWebScrapeHTMLParamsCountry = "mv"
	WebWebScrapeHTMLParamsCountryMw WebWebScrapeHTMLParamsCountry = "mw"
	WebWebScrapeHTMLParamsCountryMx WebWebScrapeHTMLParamsCountry = "mx"
	WebWebScrapeHTMLParamsCountryMy WebWebScrapeHTMLParamsCountry = "my"
	WebWebScrapeHTMLParamsCountryMz WebWebScrapeHTMLParamsCountry = "mz"
	WebWebScrapeHTMLParamsCountryNa WebWebScrapeHTMLParamsCountry = "na"
	WebWebScrapeHTMLParamsCountryNc WebWebScrapeHTMLParamsCountry = "nc"
	WebWebScrapeHTMLParamsCountryNe WebWebScrapeHTMLParamsCountry = "ne"
	WebWebScrapeHTMLParamsCountryNg WebWebScrapeHTMLParamsCountry = "ng"
	WebWebScrapeHTMLParamsCountryNi WebWebScrapeHTMLParamsCountry = "ni"
	WebWebScrapeHTMLParamsCountryNl WebWebScrapeHTMLParamsCountry = "nl"
	WebWebScrapeHTMLParamsCountryNo WebWebScrapeHTMLParamsCountry = "no"
	WebWebScrapeHTMLParamsCountryNp WebWebScrapeHTMLParamsCountry = "np"
	WebWebScrapeHTMLParamsCountryNz WebWebScrapeHTMLParamsCountry = "nz"
	WebWebScrapeHTMLParamsCountryOm WebWebScrapeHTMLParamsCountry = "om"
	WebWebScrapeHTMLParamsCountryPa WebWebScrapeHTMLParamsCountry = "pa"
	WebWebScrapeHTMLParamsCountryPe WebWebScrapeHTMLParamsCountry = "pe"
	WebWebScrapeHTMLParamsCountryPf WebWebScrapeHTMLParamsCountry = "pf"
	WebWebScrapeHTMLParamsCountryPg WebWebScrapeHTMLParamsCountry = "pg"
	WebWebScrapeHTMLParamsCountryPh WebWebScrapeHTMLParamsCountry = "ph"
	WebWebScrapeHTMLParamsCountryPk WebWebScrapeHTMLParamsCountry = "pk"
	WebWebScrapeHTMLParamsCountryPl WebWebScrapeHTMLParamsCountry = "pl"
	WebWebScrapeHTMLParamsCountryPr WebWebScrapeHTMLParamsCountry = "pr"
	WebWebScrapeHTMLParamsCountryPs WebWebScrapeHTMLParamsCountry = "ps"
	WebWebScrapeHTMLParamsCountryPt WebWebScrapeHTMLParamsCountry = "pt"
	WebWebScrapeHTMLParamsCountryPy WebWebScrapeHTMLParamsCountry = "py"
	WebWebScrapeHTMLParamsCountryQa WebWebScrapeHTMLParamsCountry = "qa"
	WebWebScrapeHTMLParamsCountryRe WebWebScrapeHTMLParamsCountry = "re"
	WebWebScrapeHTMLParamsCountryRo WebWebScrapeHTMLParamsCountry = "ro"
	WebWebScrapeHTMLParamsCountryRs WebWebScrapeHTMLParamsCountry = "rs"
	WebWebScrapeHTMLParamsCountryRu WebWebScrapeHTMLParamsCountry = "ru"
	WebWebScrapeHTMLParamsCountryRw WebWebScrapeHTMLParamsCountry = "rw"
	WebWebScrapeHTMLParamsCountrySa WebWebScrapeHTMLParamsCountry = "sa"
	WebWebScrapeHTMLParamsCountrySc WebWebScrapeHTMLParamsCountry = "sc"
	WebWebScrapeHTMLParamsCountrySd WebWebScrapeHTMLParamsCountry = "sd"
	WebWebScrapeHTMLParamsCountrySe WebWebScrapeHTMLParamsCountry = "se"
	WebWebScrapeHTMLParamsCountrySg WebWebScrapeHTMLParamsCountry = "sg"
	WebWebScrapeHTMLParamsCountrySi WebWebScrapeHTMLParamsCountry = "si"
	WebWebScrapeHTMLParamsCountrySk WebWebScrapeHTMLParamsCountry = "sk"
	WebWebScrapeHTMLParamsCountrySl WebWebScrapeHTMLParamsCountry = "sl"
	WebWebScrapeHTMLParamsCountrySm WebWebScrapeHTMLParamsCountry = "sm"
	WebWebScrapeHTMLParamsCountrySn WebWebScrapeHTMLParamsCountry = "sn"
	WebWebScrapeHTMLParamsCountrySo WebWebScrapeHTMLParamsCountry = "so"
	WebWebScrapeHTMLParamsCountrySr WebWebScrapeHTMLParamsCountry = "sr"
	WebWebScrapeHTMLParamsCountrySS WebWebScrapeHTMLParamsCountry = "ss"
	WebWebScrapeHTMLParamsCountrySt WebWebScrapeHTMLParamsCountry = "st"
	WebWebScrapeHTMLParamsCountrySv WebWebScrapeHTMLParamsCountry = "sv"
	WebWebScrapeHTMLParamsCountrySx WebWebScrapeHTMLParamsCountry = "sx"
	WebWebScrapeHTMLParamsCountrySy WebWebScrapeHTMLParamsCountry = "sy"
	WebWebScrapeHTMLParamsCountrySz WebWebScrapeHTMLParamsCountry = "sz"
	WebWebScrapeHTMLParamsCountryTc WebWebScrapeHTMLParamsCountry = "tc"
	WebWebScrapeHTMLParamsCountryTd WebWebScrapeHTMLParamsCountry = "td"
	WebWebScrapeHTMLParamsCountryTg WebWebScrapeHTMLParamsCountry = "tg"
	WebWebScrapeHTMLParamsCountryTh WebWebScrapeHTMLParamsCountry = "th"
	WebWebScrapeHTMLParamsCountryTj WebWebScrapeHTMLParamsCountry = "tj"
	WebWebScrapeHTMLParamsCountryTl WebWebScrapeHTMLParamsCountry = "tl"
	WebWebScrapeHTMLParamsCountryTm WebWebScrapeHTMLParamsCountry = "tm"
	WebWebScrapeHTMLParamsCountryTn WebWebScrapeHTMLParamsCountry = "tn"
	WebWebScrapeHTMLParamsCountryTr WebWebScrapeHTMLParamsCountry = "tr"
	WebWebScrapeHTMLParamsCountryTt WebWebScrapeHTMLParamsCountry = "tt"
	WebWebScrapeHTMLParamsCountryTw WebWebScrapeHTMLParamsCountry = "tw"
	WebWebScrapeHTMLParamsCountryTz WebWebScrapeHTMLParamsCountry = "tz"
	WebWebScrapeHTMLParamsCountryUa WebWebScrapeHTMLParamsCountry = "ua"
	WebWebScrapeHTMLParamsCountryUg WebWebScrapeHTMLParamsCountry = "ug"
	WebWebScrapeHTMLParamsCountryUs WebWebScrapeHTMLParamsCountry = "us"
	WebWebScrapeHTMLParamsCountryUy WebWebScrapeHTMLParamsCountry = "uy"
	WebWebScrapeHTMLParamsCountryUz WebWebScrapeHTMLParamsCountry = "uz"
	WebWebScrapeHTMLParamsCountryVc WebWebScrapeHTMLParamsCountry = "vc"
	WebWebScrapeHTMLParamsCountryVe WebWebScrapeHTMLParamsCountry = "ve"
	WebWebScrapeHTMLParamsCountryVg WebWebScrapeHTMLParamsCountry = "vg"
	WebWebScrapeHTMLParamsCountryVi WebWebScrapeHTMLParamsCountry = "vi"
	WebWebScrapeHTMLParamsCountryVn WebWebScrapeHTMLParamsCountry = "vn"
	WebWebScrapeHTMLParamsCountryYe WebWebScrapeHTMLParamsCountry = "ye"
	WebWebScrapeHTMLParamsCountryYt WebWebScrapeHTMLParamsCountry = "yt"
	WebWebScrapeHTMLParamsCountryZa WebWebScrapeHTMLParamsCountry = "za"
	WebWebScrapeHTMLParamsCountryZm WebWebScrapeHTMLParamsCountry = "zm"
	WebWebScrapeHTMLParamsCountryZw WebWebScrapeHTMLParamsCountry = "zw"
)

type WebWebScrapeHTMLParamsIncludeFramesString added in v2.5.0

type WebWebScrapeHTMLParamsIncludeFramesString string
const (
	WebWebScrapeHTMLParamsIncludeFramesStringTrue  WebWebScrapeHTMLParamsIncludeFramesString = "true"
	WebWebScrapeHTMLParamsIncludeFramesStringFalse WebWebScrapeHTMLParamsIncludeFramesString = "false"
)

type WebWebScrapeHTMLParamsIncludeFramesUnion added in v2.5.0

type WebWebScrapeHTMLParamsIncludeFramesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeHTMLsIncludeFramesString)
	OfWebWebScrapeHTMLsIncludeFramesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsPdf

type WebWebScrapeHTMLParamsPdf struct {
	// Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
	// Must be greater than or equal to start when both are provided.
	End param.Opt[int64] `query:"end,omitzero" json:"-"`
	// First 1-based PDF page to parse. When omitted, parsing starts at the first page.
	Start param.Opt[int64] `query:"start,omitzero" json:"-"`
	// When true, detect and OCR images embedded in the selected PDF pages, inserting
	// recognized text at each image's position in page reading order while preserving
	// the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
	Ocr WebWebScrapeHTMLParamsPdfOcrUnion `query:"ocr,omitzero" json:"-"`
	// When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
	// a 400 WEBSITE_ACCESS_ERROR is returned.
	ShouldParse WebWebScrapeHTMLParamsPdfShouldParseUnion `query:"shouldParse,omitzero" json:"-"`
	// contains filtered or unexported fields
}

PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.

func (WebWebScrapeHTMLParamsPdf) URLQuery

func (r WebWebScrapeHTMLParamsPdf) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeHTMLParamsPdf's query parameters as `url.Values`.

type WebWebScrapeHTMLParamsPdfOcrString added in v2.5.0

type WebWebScrapeHTMLParamsPdfOcrString string
const (
	WebWebScrapeHTMLParamsPdfOcrStringTrue  WebWebScrapeHTMLParamsPdfOcrString = "true"
	WebWebScrapeHTMLParamsPdfOcrStringFalse WebWebScrapeHTMLParamsPdfOcrString = "false"
)

type WebWebScrapeHTMLParamsPdfOcrUnion added in v2.5.0

type WebWebScrapeHTMLParamsPdfOcrUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeHTMLsPdfOcrString)
	OfWebWebScrapeHTMLsPdfOcrString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsPdfShouldParseString added in v2.5.0

type WebWebScrapeHTMLParamsPdfShouldParseString string
const (
	WebWebScrapeHTMLParamsPdfShouldParseStringTrue  WebWebScrapeHTMLParamsPdfShouldParseString = "true"
	WebWebScrapeHTMLParamsPdfShouldParseStringFalse WebWebScrapeHTMLParamsPdfShouldParseString = "false"
)

type WebWebScrapeHTMLParamsPdfShouldParseUnion added in v2.5.0

type WebWebScrapeHTMLParamsPdfShouldParseUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeHTMLsPdfShouldParseString)
	OfWebWebScrapeHTMLsPdfShouldParseString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsSettleAnimationsString added in v2.5.0

type WebWebScrapeHTMLParamsSettleAnimationsString string
const (
	WebWebScrapeHTMLParamsSettleAnimationsStringTrue  WebWebScrapeHTMLParamsSettleAnimationsString = "true"
	WebWebScrapeHTMLParamsSettleAnimationsStringFalse WebWebScrapeHTMLParamsSettleAnimationsString = "false"
)

type WebWebScrapeHTMLParamsSettleAnimationsUnion added in v2.5.0

type WebWebScrapeHTMLParamsSettleAnimationsUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeHTMLsSettleAnimationsString)
	OfWebWebScrapeHTMLsSettleAnimationsString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsUseMainContentOnlyString added in v2.5.0

type WebWebScrapeHTMLParamsUseMainContentOnlyString string
const (
	WebWebScrapeHTMLParamsUseMainContentOnlyStringTrue  WebWebScrapeHTMLParamsUseMainContentOnlyString = "true"
	WebWebScrapeHTMLParamsUseMainContentOnlyStringFalse WebWebScrapeHTMLParamsUseMainContentOnlyString = "false"
)

type WebWebScrapeHTMLParamsUseMainContentOnlyUnion added in v2.5.0

type WebWebScrapeHTMLParamsUseMainContentOnlyUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeHTMLsUseMainContentOnlyString)
	OfWebWebScrapeHTMLsUseMainContentOnlyString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeHTMLParamsZdr added in v2.5.0

type WebWebScrapeHTMLParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	WebWebScrapeHTMLParamsZdrEnabled  WebWebScrapeHTMLParamsZdr = "enabled"
	WebWebScrapeHTMLParamsZdrDisabled WebWebScrapeHTMLParamsZdr = "disabled"
)

type WebWebScrapeHTMLResponse

type WebWebScrapeHTMLResponse struct {
	// The scraped content of the page. For normal pages this is the raw HTML. When the
	// page is a sitemap or feed served behind an XSL stylesheet (which browsers render
	// into HTML), this is the underlying XML instead — see the `type` field.
	HTML string `json:"html" api:"required"`
	// Metadata extracted from the scraped page HTML.
	Metadata WebWebScrapeHTMLResponseMetadata `json:"metadata" api:"required"`
	// Indicates success
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// Detected content type of the returned `html` field. Sitemaps and feeds are
	// surfaced as `xml`; ordinary pages are `html`. Excel workbooks are surfaced as
	// `xlsx`/`xls` with the extracted sheets as HTML tables; PowerPoint presentations
	// are surfaced as `pptx`/`ppt` with the extracted slides as HTML.
	//
	// Any of "html", "xml", "json", "text", "csv", "markdown", "svg", "pdf", "docx",
	// "doc", "xlsx", "xls", "pptx", "ppt".
	Type WebWebScrapeHTMLResponseType `json:"type" api:"required"`
	// The URL that was scraped
	URL string `json:"url" api:"required"`
	// One verified outcome per requested browser action, in request order.
	ActionsApplied []WebWebScrapeHTMLResponseActionsApplied `json:"actionsApplied"`
	// True when an action was applied but the returned content could not be refreshed
	// afterward.
	ActionsHTMLStale bool `json:"actionsHtmlStale"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebWebScrapeHTMLResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HTML             respjson.Field
		Metadata         respjson.Field
		Success          respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		ActionsApplied   respjson.Field
		ActionsHTMLStale respjson.Field
		KeyMetadata      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeHTMLResponse) RawJSON

func (r WebWebScrapeHTMLResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponse) UnmarshalJSON

func (r *WebWebScrapeHTMLResponse) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseActionsApplied added in v2.6.0

type WebWebScrapeHTMLResponseActionsApplied struct {
	Instruction string `json:"instruction" api:"required"`
	// Applied means the requested page state was visibly verified. Failed means it was
	// not verified. Skipped means it was not attempted.
	//
	// Any of "applied", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Visible page evidence used to verify an applied action.
	CompletionEvidence string  `json:"completionEvidence"`
	DurationMs         float64 `json:"durationMs"`
	Error              string  `json:"error"`
	Method             string  `json:"method"`
	TargetDescription  string  `json:"targetDescription"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instruction        respjson.Field
		Status             respjson.Field
		CompletionEvidence respjson.Field
		DurationMs         respjson.Field
		Error              respjson.Field
		Method             respjson.Field
		TargetDescription  respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeHTMLResponseActionsApplied) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseActionsApplied) UnmarshalJSON added in v2.6.0

func (r *WebWebScrapeHTMLResponseActionsApplied) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseKeyMetadata

type WebWebScrapeHTMLResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebWebScrapeHTMLResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseKeyMetadata) UnmarshalJSON

func (r *WebWebScrapeHTMLResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseMetadata

type WebWebScrapeHTMLResponseMetadata struct {
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []WebWebScrapeHTMLResponseMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]WebWebScrapeHTMLResponseMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Best title extracted from the page.
	Title string `json:"title"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]WebWebScrapeHTMLResponseMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Title          respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata extracted from the scraped page HTML.

func (WebWebScrapeHTMLResponseMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseMetadata) UnmarshalJSON

func (r *WebWebScrapeHTMLResponseMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion

type WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsString

func (WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsStringArray

func (WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) UnmarshalJSON

type WebWebScrapeHTMLResponseMetadataAlternate

type WebWebScrapeHTMLResponseMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeHTMLResponseMetadataAlternate) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseMetadataAlternate) UnmarshalJSON

func (r *WebWebScrapeHTMLResponseMetadataAlternate) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseMetadataOpenGraphUnion

type WebWebScrapeHTMLResponseMetadataOpenGraphUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeHTMLResponseMetadataOpenGraphUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsString

func (WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsStringArray

func (WebWebScrapeHTMLResponseMetadataOpenGraphUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseMetadataOpenGraphUnion) UnmarshalJSON

type WebWebScrapeHTMLResponseMetadataTwitterUnion

type WebWebScrapeHTMLResponseMetadataTwitterUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeHTMLResponseMetadataTwitterUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeHTMLResponseMetadataTwitterUnion) AsString

func (WebWebScrapeHTMLResponseMetadataTwitterUnion) AsStringArray

func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) AsStringArray() (v []string)

func (WebWebScrapeHTMLResponseMetadataTwitterUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeHTMLResponseMetadataTwitterUnion) UnmarshalJSON

func (r *WebWebScrapeHTMLResponseMetadataTwitterUnion) UnmarshalJSON(data []byte) error

type WebWebScrapeHTMLResponseType

type WebWebScrapeHTMLResponseType string

Detected content type of the returned `html` field. Sitemaps and feeds are surfaced as `xml`; ordinary pages are `html`. Excel workbooks are surfaced as `xlsx`/`xls` with the extracted sheets as HTML tables; PowerPoint presentations are surfaced as `pptx`/`ppt` with the extracted slides as HTML.

const (
	WebWebScrapeHTMLResponseTypeHTML     WebWebScrapeHTMLResponseType = "html"
	WebWebScrapeHTMLResponseTypeXml      WebWebScrapeHTMLResponseType = "xml"
	WebWebScrapeHTMLResponseTypeJson     WebWebScrapeHTMLResponseType = "json"
	WebWebScrapeHTMLResponseTypeText     WebWebScrapeHTMLResponseType = "text"
	WebWebScrapeHTMLResponseTypeCsv      WebWebScrapeHTMLResponseType = "csv"
	WebWebScrapeHTMLResponseTypeMarkdown WebWebScrapeHTMLResponseType = "markdown"
	WebWebScrapeHTMLResponseTypeSvg      WebWebScrapeHTMLResponseType = "svg"
	WebWebScrapeHTMLResponseTypePdf      WebWebScrapeHTMLResponseType = "pdf"
	WebWebScrapeHTMLResponseTypeDocx     WebWebScrapeHTMLResponseType = "docx"
	WebWebScrapeHTMLResponseTypeDoc      WebWebScrapeHTMLResponseType = "doc"
	WebWebScrapeHTMLResponseTypeXlsx     WebWebScrapeHTMLResponseType = "xlsx"
	WebWebScrapeHTMLResponseTypeXls      WebWebScrapeHTMLResponseType = "xls"
	WebWebScrapeHTMLResponseTypePptx     WebWebScrapeHTMLResponseType = "pptx"
	WebWebScrapeHTMLResponseTypePpt      WebWebScrapeHTMLResponseType = "ppt"
)

type WebWebScrapeImagesParams

type WebWebScrapeImagesParams struct {
	// Page URL to inspect. Must include http:// or https://.
	URL string `query:"url" api:"required" format:"uri" json:"-"`
	// Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
	// day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional browser wait time in milliseconds after initial page load before
	// collecting images. Min: 0. Max: 30000 (30 seconds).
	WaitForMs param.Opt[int64] `query:"waitForMs,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional browser actions executed in array order after the page loads and before
	// content is captured. Requires a paid plan. Send a JSON array in the query
	// parameter. Maximum: 5 actions.
	Actions []WebWebScrapeImagesParamsActionUnion `query:"actions,omitzero" json:"-"`
	// Optional per-image processing, sent as deep-object query params such as
	// enrichment[resolution]=true.
	Enrichment WebWebScrapeImagesParamsEnrichment `query:"enrichment,omitzero" json:"-"`
	// When true, visually duplicate images are removed: every image is loaded and
	// perceptually hashed, and only the highest-resolution copy of each duplicate
	// group is kept. Images that cannot be downloaded or hashed are kept. Default:
	// false.
	Dedupe WebWebScrapeImagesParamsDedupeUnion `query:"dedupe,omitzero" json:"-"`
	// Optional outbound HTTP headers forwarded only to the target URL, sent as
	// deep-object query params such as headers[X-Custom]=value. When provided, caching
	// is bypassed: the result is neither read from nor written to cache.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebWebScrapeImagesParams) URLQuery

func (r WebWebScrapeImagesParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeImagesParams's query parameters as `url.Values`.

type WebWebScrapeImagesParamsActionPerform added in v2.5.0

type WebWebScrapeImagesParamsActionPerform struct {
	Action string `query:"action" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "perform".
	Do constant.Perform `query:"do" json:"-" default:"perform"`
	// contains filtered or unexported fields
}

Resolve and perform one natural-language browser action.

The properties Action, Do are required.

func (WebWebScrapeImagesParamsActionPerform) URLQuery added in v2.5.0

func (r WebWebScrapeImagesParamsActionPerform) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeImagesParamsActionPerform's query parameters as `url.Values`.

type WebWebScrapeImagesParamsActionUnion added in v2.5.0

type WebWebScrapeImagesParamsActionUnion struct {
	OfWait    *WebWebScrapeImagesParamsActionWait    `query:",omitzero,inline"`
	OfPerform *WebWebScrapeImagesParamsActionPerform `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeImagesParamsActionWait added in v2.5.0

type WebWebScrapeImagesParamsActionWait struct {
	TimeMs int64 `query:"timeMs" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "wait".
	Do constant.Wait `query:"do" json:"-" default:"wait"`
	// contains filtered or unexported fields
}

Pause for a fixed number of milliseconds before continuing to the next action.

The properties Do, TimeMs are required.

func (WebWebScrapeImagesParamsActionWait) URLQuery added in v2.5.0

func (r WebWebScrapeImagesParamsActionWait) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeImagesParamsActionWait's query parameters as `url.Values`.

type WebWebScrapeImagesParamsDedupeString added in v2.5.0

type WebWebScrapeImagesParamsDedupeString string
const (
	WebWebScrapeImagesParamsDedupeStringTrue  WebWebScrapeImagesParamsDedupeString = "true"
	WebWebScrapeImagesParamsDedupeStringFalse WebWebScrapeImagesParamsDedupeString = "false"
)

type WebWebScrapeImagesParamsDedupeUnion added in v2.5.0

type WebWebScrapeImagesParamsDedupeUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeImagessDedupeString)
	OfWebWebScrapeImagessDedupeString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeImagesParamsEnrichment

type WebWebScrapeImagesParamsEnrichment struct {
	// Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
	MaxTimePerMs param.Opt[int64] `query:"maxTimePerMs,omitzero" json:"-"`
	// Classify each image by visual asset type.
	Classification WebWebScrapeImagesParamsEnrichmentClassificationUnion `query:"classification,omitzero" json:"-"`
	// Host materializable images on the Brand.dev CDN and return their URL and MIME
	// type.
	HostedURL WebWebScrapeImagesParamsEnrichmentHostedURLUnion `query:"hostedUrl,omitzero" json:"-"`
	// Measure image width and height when possible.
	Resolution WebWebScrapeImagesParamsEnrichmentResolutionUnion `query:"resolution,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.

func (WebWebScrapeImagesParamsEnrichment) URLQuery

func (r WebWebScrapeImagesParamsEnrichment) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeImagesParamsEnrichment's query parameters as `url.Values`.

type WebWebScrapeImagesParamsEnrichmentClassificationString added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentClassificationString string
const (
	WebWebScrapeImagesParamsEnrichmentClassificationStringTrue  WebWebScrapeImagesParamsEnrichmentClassificationString = "true"
	WebWebScrapeImagesParamsEnrichmentClassificationStringFalse WebWebScrapeImagesParamsEnrichmentClassificationString = "false"
)

type WebWebScrapeImagesParamsEnrichmentClassificationUnion added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentClassificationUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeImagessEnrichmentClassificationString)
	OfWebWebScrapeImagessEnrichmentClassificationString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeImagesParamsEnrichmentHostedURLString added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentHostedURLString string
const (
	WebWebScrapeImagesParamsEnrichmentHostedURLStringTrue  WebWebScrapeImagesParamsEnrichmentHostedURLString = "true"
	WebWebScrapeImagesParamsEnrichmentHostedURLStringFalse WebWebScrapeImagesParamsEnrichmentHostedURLString = "false"
)

type WebWebScrapeImagesParamsEnrichmentHostedURLUnion added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentHostedURLUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeImagessEnrichmentHostedURLString)
	OfWebWebScrapeImagessEnrichmentHostedURLString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeImagesParamsEnrichmentResolutionString added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentResolutionString string
const (
	WebWebScrapeImagesParamsEnrichmentResolutionStringTrue  WebWebScrapeImagesParamsEnrichmentResolutionString = "true"
	WebWebScrapeImagesParamsEnrichmentResolutionStringFalse WebWebScrapeImagesParamsEnrichmentResolutionString = "false"
)

type WebWebScrapeImagesParamsEnrichmentResolutionUnion added in v2.5.0

type WebWebScrapeImagesParamsEnrichmentResolutionUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeImagessEnrichmentResolutionString)
	OfWebWebScrapeImagessEnrichmentResolutionString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeImagesResponse

type WebWebScrapeImagesResponse struct {
	// Images found on the page.
	Images []WebWebScrapeImagesResponseImage `json:"images" api:"required"`
	// Always true on success.
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// Page URL that was scraped.
	URL string `json:"url" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebWebScrapeImagesResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Images      respjson.Field
		Success     respjson.Field
		URL         respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeImagesResponse) RawJSON

func (r WebWebScrapeImagesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebScrapeImagesResponse) UnmarshalJSON

func (r *WebWebScrapeImagesResponse) UnmarshalJSON(data []byte) error

type WebWebScrapeImagesResponseImage

type WebWebScrapeImagesResponseImage struct {
	// Image alt text, or null when unavailable.
	Alt string `json:"alt" api:"required"`
	// Where the image was found.
	//
	// Any of "img", "svg", "link", "source", "video", "css", "object", "meta",
	// "background".
	Element string `json:"element" api:"required"`
	// Original image value: URL, inline SVG or HTML, or base64 data URI.
	Src string `json:"src" api:"required"`
	// Format of src.
	//
	// Any of "url", "html", "base64".
	Type string `json:"type" api:"required"`
	// Requested metadata for images that could be processed.
	Enrichment WebWebScrapeImagesResponseImageEnrichment `json:"enrichment"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Alt         respjson.Field
		Element     respjson.Field
		Src         respjson.Field
		Type        respjson.Field
		Enrichment  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeImagesResponseImage) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeImagesResponseImage) UnmarshalJSON

func (r *WebWebScrapeImagesResponseImage) UnmarshalJSON(data []byte) error

type WebWebScrapeImagesResponseImageEnrichment

type WebWebScrapeImagesResponseImageEnrichment struct {
	// Image height in pixels, when measured.
	Height int64 `json:"height"`
	// Detected MIME type, when hosted.
	Mimetype string `json:"mimetype"`
	// Visual asset category, when classified.
	//
	// Any of "photography", "illustration", "logo", "wordmark", "icon", "pattern",
	// "graphic", "other".
	Type string `json:"type"`
	// Brand.dev CDN URL, when hosted.
	URL string `json:"url" format:"uri"`
	// Image width in pixels, when measured.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Height      respjson.Field
		Mimetype    respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Requested metadata for images that could be processed.

func (WebWebScrapeImagesResponseImageEnrichment) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeImagesResponseImageEnrichment) UnmarshalJSON

func (r *WebWebScrapeImagesResponseImageEnrichment) UnmarshalJSON(data []byte) error

type WebWebScrapeImagesResponseKeyMetadata

type WebWebScrapeImagesResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebWebScrapeImagesResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeImagesResponseKeyMetadata) UnmarshalJSON

func (r *WebWebScrapeImagesResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeMdParams

type WebWebScrapeMdParams struct {
	// Full URL to scrape into LLM usable Markdown (must include http:// or https://
	// protocol)
	URL string `query:"url" api:"required" format:"uri" json:"-"`
	// Return a cached result if a prior scrape for the same parameters exists and is
	// younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional browser wait time in milliseconds after initial page load before
	// converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
	WaitForMs param.Opt[int64] `query:"waitForMs,omitzero" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional browser actions executed in array order after the page loads and before
	// content is captured. Requires a paid plan. Send a JSON array in the query
	// parameter. Maximum: 5 actions.
	Actions []WebWebScrapeMdParamsActionUnion `query:"actions,omitzero" json:"-"`
	// CSS selectors to remove before conversion to Markdown. Applied after
	// includeSelectors. Exclusion takes precedence: an element matching both is
	// removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
	ExcludeSelectors []string `query:"excludeSelectors,omitzero" json:"-"`
	// CSS selectors. When provided, only matching HTML subtrees (and their
	// descendants) are kept before conversion to Markdown. When omitted, the entire
	// document is kept. Examples: "article.main", "#content", "[role=main]".
	IncludeSelectors []string `query:"includeSelectors,omitzero" json:"-"`
	// Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
	// residential proxy exit location. Must be one of Context.dev's supported
	// countries. When provided, Context.dev fetches the target page from that country.
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebWebScrapeMdParamsCountry `query:"country,omitzero" json:"-"`
	// Optional outbound HTTP headers forwarded only to the target URL, sent as
	// deep-object query params such as headers[X-Custom]=value. When provided, caching
	// is bypassed: the result is neither read from nor written to cache.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// When true, the contents of iframes are rendered to Markdown.
	IncludeFrames WebWebScrapeMdParamsIncludeFramesUnion `query:"includeFrames,omitzero" json:"-"`
	// Include image references in Markdown output
	IncludeImages WebWebScrapeMdParamsIncludeImagesUnion `query:"includeImages,omitzero" json:"-"`
	// Preserve hyperlinks in Markdown output
	IncludeLinks WebWebScrapeMdParamsIncludeLinksUnion `query:"includeLinks,omitzero" json:"-"`
	// PDF parsing controls. Use start/end to limit text extraction and embedded-image
	// detection/OCR to an inclusive 1-based page range.
	Pdf WebWebScrapeMdParamsPdf `query:"pdf,omitzero" json:"-"`
	// When true, waits briefly for CSS and transition animations to settle before
	// converting to Markdown. Defaults to false. This adds a bit of latency in
	// exchange for more stable output on animated pages.
	SettleAnimations WebWebScrapeMdParamsSettleAnimationsUnion `query:"settleAnimations,omitzero" json:"-"`
	// Shorten base64-encoded image data in the Markdown output
	ShortenBase64Images WebWebScrapeMdParamsShortenBase64ImagesUnion `query:"shortenBase64Images,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Extract only the main content of the page, excluding headers, footers, sidebars,
	// and navigation
	UseMainContentOnly WebWebScrapeMdParamsUseMainContentOnlyUnion `query:"useMainContentOnly,omitzero" json:"-"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr WebWebScrapeMdParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebWebScrapeMdParams) URLQuery

func (r WebWebScrapeMdParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeMdParams's query parameters as `url.Values`.

type WebWebScrapeMdParamsActionPerform added in v2.5.0

type WebWebScrapeMdParamsActionPerform struct {
	Action string `query:"action" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "perform".
	Do constant.Perform `query:"do" json:"-" default:"perform"`
	// contains filtered or unexported fields
}

Resolve and perform one natural-language browser action.

The properties Action, Do are required.

func (WebWebScrapeMdParamsActionPerform) URLQuery added in v2.5.0

func (r WebWebScrapeMdParamsActionPerform) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeMdParamsActionPerform's query parameters as `url.Values`.

type WebWebScrapeMdParamsActionUnion added in v2.5.0

type WebWebScrapeMdParamsActionUnion struct {
	OfWait    *WebWebScrapeMdParamsActionWait    `query:",omitzero,inline"`
	OfPerform *WebWebScrapeMdParamsActionPerform `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsActionWait added in v2.5.0

type WebWebScrapeMdParamsActionWait struct {
	TimeMs int64 `query:"timeMs" api:"required" json:"-"`
	// This field can be elided, and will marshal its zero value as "wait".
	Do constant.Wait `query:"do" json:"-" default:"wait"`
	// contains filtered or unexported fields
}

Pause for a fixed number of milliseconds before continuing to the next action.

The properties Do, TimeMs are required.

func (WebWebScrapeMdParamsActionWait) URLQuery added in v2.5.0

func (r WebWebScrapeMdParamsActionWait) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeMdParamsActionWait's query parameters as `url.Values`.

type WebWebScrapeMdParamsCountry

type WebWebScrapeMdParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.

const (
	WebWebScrapeMdParamsCountryAd WebWebScrapeMdParamsCountry = "ad"
	WebWebScrapeMdParamsCountryAe WebWebScrapeMdParamsCountry = "ae"
	WebWebScrapeMdParamsCountryAf WebWebScrapeMdParamsCountry = "af"
	WebWebScrapeMdParamsCountryAg WebWebScrapeMdParamsCountry = "ag"
	WebWebScrapeMdParamsCountryAI WebWebScrapeMdParamsCountry = "ai"
	WebWebScrapeMdParamsCountryAl WebWebScrapeMdParamsCountry = "al"
	WebWebScrapeMdParamsCountryAm WebWebScrapeMdParamsCountry = "am"
	WebWebScrapeMdParamsCountryAo WebWebScrapeMdParamsCountry = "ao"
	WebWebScrapeMdParamsCountryAr WebWebScrapeMdParamsCountry = "ar"
	WebWebScrapeMdParamsCountryAt WebWebScrapeMdParamsCountry = "at"
	WebWebScrapeMdParamsCountryAu WebWebScrapeMdParamsCountry = "au"
	WebWebScrapeMdParamsCountryAw WebWebScrapeMdParamsCountry = "aw"
	WebWebScrapeMdParamsCountryAz WebWebScrapeMdParamsCountry = "az"
	WebWebScrapeMdParamsCountryBa WebWebScrapeMdParamsCountry = "ba"
	WebWebScrapeMdParamsCountryBb WebWebScrapeMdParamsCountry = "bb"
	WebWebScrapeMdParamsCountryBd WebWebScrapeMdParamsCountry = "bd"
	WebWebScrapeMdParamsCountryBe WebWebScrapeMdParamsCountry = "be"
	WebWebScrapeMdParamsCountryBf WebWebScrapeMdParamsCountry = "bf"
	WebWebScrapeMdParamsCountryBg WebWebScrapeMdParamsCountry = "bg"
	WebWebScrapeMdParamsCountryBh WebWebScrapeMdParamsCountry = "bh"
	WebWebScrapeMdParamsCountryBi WebWebScrapeMdParamsCountry = "bi"
	WebWebScrapeMdParamsCountryBj WebWebScrapeMdParamsCountry = "bj"
	WebWebScrapeMdParamsCountryBm WebWebScrapeMdParamsCountry = "bm"
	WebWebScrapeMdParamsCountryBn WebWebScrapeMdParamsCountry = "bn"
	WebWebScrapeMdParamsCountryBo WebWebScrapeMdParamsCountry = "bo"
	WebWebScrapeMdParamsCountryBq WebWebScrapeMdParamsCountry = "bq"
	WebWebScrapeMdParamsCountryBr WebWebScrapeMdParamsCountry = "br"
	WebWebScrapeMdParamsCountryBs WebWebScrapeMdParamsCountry = "bs"
	WebWebScrapeMdParamsCountryBw WebWebScrapeMdParamsCountry = "bw"
	WebWebScrapeMdParamsCountryBy WebWebScrapeMdParamsCountry = "by"
	WebWebScrapeMdParamsCountryBz WebWebScrapeMdParamsCountry = "bz"
	WebWebScrapeMdParamsCountryCa WebWebScrapeMdParamsCountry = "ca"
	WebWebScrapeMdParamsCountryCd WebWebScrapeMdParamsCountry = "cd"
	WebWebScrapeMdParamsCountryCf WebWebScrapeMdParamsCountry = "cf"
	WebWebScrapeMdParamsCountryCg WebWebScrapeMdParamsCountry = "cg"
	WebWebScrapeMdParamsCountryCh WebWebScrapeMdParamsCountry = "ch"
	WebWebScrapeMdParamsCountryCi WebWebScrapeMdParamsCountry = "ci"
	WebWebScrapeMdParamsCountryCl WebWebScrapeMdParamsCountry = "cl"
	WebWebScrapeMdParamsCountryCm WebWebScrapeMdParamsCountry = "cm"
	WebWebScrapeMdParamsCountryCn WebWebScrapeMdParamsCountry = "cn"
	WebWebScrapeMdParamsCountryCo WebWebScrapeMdParamsCountry = "co"
	WebWebScrapeMdParamsCountryCr WebWebScrapeMdParamsCountry = "cr"
	WebWebScrapeMdParamsCountryCv WebWebScrapeMdParamsCountry = "cv"
	WebWebScrapeMdParamsCountryCw WebWebScrapeMdParamsCountry = "cw"
	WebWebScrapeMdParamsCountryCy WebWebScrapeMdParamsCountry = "cy"
	WebWebScrapeMdParamsCountryCz WebWebScrapeMdParamsCountry = "cz"
	WebWebScrapeMdParamsCountryDe WebWebScrapeMdParamsCountry = "de"
	WebWebScrapeMdParamsCountryDj WebWebScrapeMdParamsCountry = "dj"
	WebWebScrapeMdParamsCountryDk WebWebScrapeMdParamsCountry = "dk"
	WebWebScrapeMdParamsCountryDm WebWebScrapeMdParamsCountry = "dm"
	WebWebScrapeMdParamsCountryDo WebWebScrapeMdParamsCountry = "do"
	WebWebScrapeMdParamsCountryDz WebWebScrapeMdParamsCountry = "dz"
	WebWebScrapeMdParamsCountryEc WebWebScrapeMdParamsCountry = "ec"
	WebWebScrapeMdParamsCountryEe WebWebScrapeMdParamsCountry = "ee"
	WebWebScrapeMdParamsCountryEg WebWebScrapeMdParamsCountry = "eg"
	WebWebScrapeMdParamsCountryEs WebWebScrapeMdParamsCountry = "es"
	WebWebScrapeMdParamsCountryEt WebWebScrapeMdParamsCountry = "et"
	WebWebScrapeMdParamsCountryFi WebWebScrapeMdParamsCountry = "fi"
	WebWebScrapeMdParamsCountryFj WebWebScrapeMdParamsCountry = "fj"
	WebWebScrapeMdParamsCountryFr WebWebScrapeMdParamsCountry = "fr"
	WebWebScrapeMdParamsCountryGa WebWebScrapeMdParamsCountry = "ga"
	WebWebScrapeMdParamsCountryGB WebWebScrapeMdParamsCountry = "gb"
	WebWebScrapeMdParamsCountryGd WebWebScrapeMdParamsCountry = "gd"
	WebWebScrapeMdParamsCountryGe WebWebScrapeMdParamsCountry = "ge"
	WebWebScrapeMdParamsCountryGf WebWebScrapeMdParamsCountry = "gf"
	WebWebScrapeMdParamsCountryGg WebWebScrapeMdParamsCountry = "gg"
	WebWebScrapeMdParamsCountryGh WebWebScrapeMdParamsCountry = "gh"
	WebWebScrapeMdParamsCountryGm WebWebScrapeMdParamsCountry = "gm"
	WebWebScrapeMdParamsCountryGn WebWebScrapeMdParamsCountry = "gn"
	WebWebScrapeMdParamsCountryGp WebWebScrapeMdParamsCountry = "gp"
	WebWebScrapeMdParamsCountryGq WebWebScrapeMdParamsCountry = "gq"
	WebWebScrapeMdParamsCountryGr WebWebScrapeMdParamsCountry = "gr"
	WebWebScrapeMdParamsCountryGt WebWebScrapeMdParamsCountry = "gt"
	WebWebScrapeMdParamsCountryGu WebWebScrapeMdParamsCountry = "gu"
	WebWebScrapeMdParamsCountryGw WebWebScrapeMdParamsCountry = "gw"
	WebWebScrapeMdParamsCountryGy WebWebScrapeMdParamsCountry = "gy"
	WebWebScrapeMdParamsCountryHk WebWebScrapeMdParamsCountry = "hk"
	WebWebScrapeMdParamsCountryHn WebWebScrapeMdParamsCountry = "hn"
	WebWebScrapeMdParamsCountryHr WebWebScrapeMdParamsCountry = "hr"
	WebWebScrapeMdParamsCountryHt WebWebScrapeMdParamsCountry = "ht"
	WebWebScrapeMdParamsCountryHu WebWebScrapeMdParamsCountry = "hu"
	WebWebScrapeMdParamsCountryID WebWebScrapeMdParamsCountry = "id"
	WebWebScrapeMdParamsCountryIe WebWebScrapeMdParamsCountry = "ie"
	WebWebScrapeMdParamsCountryIl WebWebScrapeMdParamsCountry = "il"
	WebWebScrapeMdParamsCountryIm WebWebScrapeMdParamsCountry = "im"
	WebWebScrapeMdParamsCountryIn WebWebScrapeMdParamsCountry = "in"
	WebWebScrapeMdParamsCountryIq WebWebScrapeMdParamsCountry = "iq"
	WebWebScrapeMdParamsCountryIr WebWebScrapeMdParamsCountry = "ir"
	WebWebScrapeMdParamsCountryIs WebWebScrapeMdParamsCountry = "is"
	WebWebScrapeMdParamsCountryIt WebWebScrapeMdParamsCountry = "it"
	WebWebScrapeMdParamsCountryJe WebWebScrapeMdParamsCountry = "je"
	WebWebScrapeMdParamsCountryJm WebWebScrapeMdParamsCountry = "jm"
	WebWebScrapeMdParamsCountryJo WebWebScrapeMdParamsCountry = "jo"
	WebWebScrapeMdParamsCountryJp WebWebScrapeMdParamsCountry = "jp"
	WebWebScrapeMdParamsCountryKe WebWebScrapeMdParamsCountry = "ke"
	WebWebScrapeMdParamsCountryKg WebWebScrapeMdParamsCountry = "kg"
	WebWebScrapeMdParamsCountryKh WebWebScrapeMdParamsCountry = "kh"
	WebWebScrapeMdParamsCountryKn WebWebScrapeMdParamsCountry = "kn"
	WebWebScrapeMdParamsCountryKr WebWebScrapeMdParamsCountry = "kr"
	WebWebScrapeMdParamsCountryKw WebWebScrapeMdParamsCountry = "kw"
	WebWebScrapeMdParamsCountryKy WebWebScrapeMdParamsCountry = "ky"
	WebWebScrapeMdParamsCountryKz WebWebScrapeMdParamsCountry = "kz"
	WebWebScrapeMdParamsCountryLa WebWebScrapeMdParamsCountry = "la"
	WebWebScrapeMdParamsCountryLb WebWebScrapeMdParamsCountry = "lb"
	WebWebScrapeMdParamsCountryLc WebWebScrapeMdParamsCountry = "lc"
	WebWebScrapeMdParamsCountryLk WebWebScrapeMdParamsCountry = "lk"
	WebWebScrapeMdParamsCountryLr WebWebScrapeMdParamsCountry = "lr"
	WebWebScrapeMdParamsCountryLs WebWebScrapeMdParamsCountry = "ls"
	WebWebScrapeMdParamsCountryLt WebWebScrapeMdParamsCountry = "lt"
	WebWebScrapeMdParamsCountryLu WebWebScrapeMdParamsCountry = "lu"
	WebWebScrapeMdParamsCountryLv WebWebScrapeMdParamsCountry = "lv"
	WebWebScrapeMdParamsCountryLy WebWebScrapeMdParamsCountry = "ly"
	WebWebScrapeMdParamsCountryMa WebWebScrapeMdParamsCountry = "ma"
	WebWebScrapeMdParamsCountryMc WebWebScrapeMdParamsCountry = "mc"
	WebWebScrapeMdParamsCountryMd WebWebScrapeMdParamsCountry = "md"
	WebWebScrapeMdParamsCountryMe WebWebScrapeMdParamsCountry = "me"
	WebWebScrapeMdParamsCountryMf WebWebScrapeMdParamsCountry = "mf"
	WebWebScrapeMdParamsCountryMg WebWebScrapeMdParamsCountry = "mg"
	WebWebScrapeMdParamsCountryMk WebWebScrapeMdParamsCountry = "mk"
	WebWebScrapeMdParamsCountryMl WebWebScrapeMdParamsCountry = "ml"
	WebWebScrapeMdParamsCountryMm WebWebScrapeMdParamsCountry = "mm"
	WebWebScrapeMdParamsCountryMn WebWebScrapeMdParamsCountry = "mn"
	WebWebScrapeMdParamsCountryMo WebWebScrapeMdParamsCountry = "mo"
	WebWebScrapeMdParamsCountryMq WebWebScrapeMdParamsCountry = "mq"
	WebWebScrapeMdParamsCountryMr WebWebScrapeMdParamsCountry = "mr"
	WebWebScrapeMdParamsCountryMt WebWebScrapeMdParamsCountry = "mt"
	WebWebScrapeMdParamsCountryMu WebWebScrapeMdParamsCountry = "mu"
	WebWebScrapeMdParamsCountryMv WebWebScrapeMdParamsCountry = "mv"
	WebWebScrapeMdParamsCountryMw WebWebScrapeMdParamsCountry = "mw"
	WebWebScrapeMdParamsCountryMx WebWebScrapeMdParamsCountry = "mx"
	WebWebScrapeMdParamsCountryMy WebWebScrapeMdParamsCountry = "my"
	WebWebScrapeMdParamsCountryMz WebWebScrapeMdParamsCountry = "mz"
	WebWebScrapeMdParamsCountryNa WebWebScrapeMdParamsCountry = "na"
	WebWebScrapeMdParamsCountryNc WebWebScrapeMdParamsCountry = "nc"
	WebWebScrapeMdParamsCountryNe WebWebScrapeMdParamsCountry = "ne"
	WebWebScrapeMdParamsCountryNg WebWebScrapeMdParamsCountry = "ng"
	WebWebScrapeMdParamsCountryNi WebWebScrapeMdParamsCountry = "ni"
	WebWebScrapeMdParamsCountryNl WebWebScrapeMdParamsCountry = "nl"
	WebWebScrapeMdParamsCountryNo WebWebScrapeMdParamsCountry = "no"
	WebWebScrapeMdParamsCountryNp WebWebScrapeMdParamsCountry = "np"
	WebWebScrapeMdParamsCountryNz WebWebScrapeMdParamsCountry = "nz"
	WebWebScrapeMdParamsCountryOm WebWebScrapeMdParamsCountry = "om"
	WebWebScrapeMdParamsCountryPa WebWebScrapeMdParamsCountry = "pa"
	WebWebScrapeMdParamsCountryPe WebWebScrapeMdParamsCountry = "pe"
	WebWebScrapeMdParamsCountryPf WebWebScrapeMdParamsCountry = "pf"
	WebWebScrapeMdParamsCountryPg WebWebScrapeMdParamsCountry = "pg"
	WebWebScrapeMdParamsCountryPh WebWebScrapeMdParamsCountry = "ph"
	WebWebScrapeMdParamsCountryPk WebWebScrapeMdParamsCountry = "pk"
	WebWebScrapeMdParamsCountryPl WebWebScrapeMdParamsCountry = "pl"
	WebWebScrapeMdParamsCountryPr WebWebScrapeMdParamsCountry = "pr"
	WebWebScrapeMdParamsCountryPs WebWebScrapeMdParamsCountry = "ps"
	WebWebScrapeMdParamsCountryPt WebWebScrapeMdParamsCountry = "pt"
	WebWebScrapeMdParamsCountryPy WebWebScrapeMdParamsCountry = "py"
	WebWebScrapeMdParamsCountryQa WebWebScrapeMdParamsCountry = "qa"
	WebWebScrapeMdParamsCountryRe WebWebScrapeMdParamsCountry = "re"
	WebWebScrapeMdParamsCountryRo WebWebScrapeMdParamsCountry = "ro"
	WebWebScrapeMdParamsCountryRs WebWebScrapeMdParamsCountry = "rs"
	WebWebScrapeMdParamsCountryRu WebWebScrapeMdParamsCountry = "ru"
	WebWebScrapeMdParamsCountryRw WebWebScrapeMdParamsCountry = "rw"
	WebWebScrapeMdParamsCountrySa WebWebScrapeMdParamsCountry = "sa"
	WebWebScrapeMdParamsCountrySc WebWebScrapeMdParamsCountry = "sc"
	WebWebScrapeMdParamsCountrySd WebWebScrapeMdParamsCountry = "sd"
	WebWebScrapeMdParamsCountrySe WebWebScrapeMdParamsCountry = "se"
	WebWebScrapeMdParamsCountrySg WebWebScrapeMdParamsCountry = "sg"
	WebWebScrapeMdParamsCountrySi WebWebScrapeMdParamsCountry = "si"
	WebWebScrapeMdParamsCountrySk WebWebScrapeMdParamsCountry = "sk"
	WebWebScrapeMdParamsCountrySl WebWebScrapeMdParamsCountry = "sl"
	WebWebScrapeMdParamsCountrySm WebWebScrapeMdParamsCountry = "sm"
	WebWebScrapeMdParamsCountrySn WebWebScrapeMdParamsCountry = "sn"
	WebWebScrapeMdParamsCountrySo WebWebScrapeMdParamsCountry = "so"
	WebWebScrapeMdParamsCountrySr WebWebScrapeMdParamsCountry = "sr"
	WebWebScrapeMdParamsCountrySS WebWebScrapeMdParamsCountry = "ss"
	WebWebScrapeMdParamsCountrySt WebWebScrapeMdParamsCountry = "st"
	WebWebScrapeMdParamsCountrySv WebWebScrapeMdParamsCountry = "sv"
	WebWebScrapeMdParamsCountrySx WebWebScrapeMdParamsCountry = "sx"
	WebWebScrapeMdParamsCountrySy WebWebScrapeMdParamsCountry = "sy"
	WebWebScrapeMdParamsCountrySz WebWebScrapeMdParamsCountry = "sz"
	WebWebScrapeMdParamsCountryTc WebWebScrapeMdParamsCountry = "tc"
	WebWebScrapeMdParamsCountryTd WebWebScrapeMdParamsCountry = "td"
	WebWebScrapeMdParamsCountryTg WebWebScrapeMdParamsCountry = "tg"
	WebWebScrapeMdParamsCountryTh WebWebScrapeMdParamsCountry = "th"
	WebWebScrapeMdParamsCountryTj WebWebScrapeMdParamsCountry = "tj"
	WebWebScrapeMdParamsCountryTl WebWebScrapeMdParamsCountry = "tl"
	WebWebScrapeMdParamsCountryTm WebWebScrapeMdParamsCountry = "tm"
	WebWebScrapeMdParamsCountryTn WebWebScrapeMdParamsCountry = "tn"
	WebWebScrapeMdParamsCountryTr WebWebScrapeMdParamsCountry = "tr"
	WebWebScrapeMdParamsCountryTt WebWebScrapeMdParamsCountry = "tt"
	WebWebScrapeMdParamsCountryTw WebWebScrapeMdParamsCountry = "tw"
	WebWebScrapeMdParamsCountryTz WebWebScrapeMdParamsCountry = "tz"
	WebWebScrapeMdParamsCountryUa WebWebScrapeMdParamsCountry = "ua"
	WebWebScrapeMdParamsCountryUg WebWebScrapeMdParamsCountry = "ug"
	WebWebScrapeMdParamsCountryUs WebWebScrapeMdParamsCountry = "us"
	WebWebScrapeMdParamsCountryUy WebWebScrapeMdParamsCountry = "uy"
	WebWebScrapeMdParamsCountryUz WebWebScrapeMdParamsCountry = "uz"
	WebWebScrapeMdParamsCountryVc WebWebScrapeMdParamsCountry = "vc"
	WebWebScrapeMdParamsCountryVe WebWebScrapeMdParamsCountry = "ve"
	WebWebScrapeMdParamsCountryVg WebWebScrapeMdParamsCountry = "vg"
	WebWebScrapeMdParamsCountryVi WebWebScrapeMdParamsCountry = "vi"
	WebWebScrapeMdParamsCountryVn WebWebScrapeMdParamsCountry = "vn"
	WebWebScrapeMdParamsCountryYe WebWebScrapeMdParamsCountry = "ye"
	WebWebScrapeMdParamsCountryYt WebWebScrapeMdParamsCountry = "yt"
	WebWebScrapeMdParamsCountryZa WebWebScrapeMdParamsCountry = "za"
	WebWebScrapeMdParamsCountryZm WebWebScrapeMdParamsCountry = "zm"
	WebWebScrapeMdParamsCountryZw WebWebScrapeMdParamsCountry = "zw"
)

type WebWebScrapeMdParamsIncludeFramesString added in v2.5.0

type WebWebScrapeMdParamsIncludeFramesString string
const (
	WebWebScrapeMdParamsIncludeFramesStringTrue  WebWebScrapeMdParamsIncludeFramesString = "true"
	WebWebScrapeMdParamsIncludeFramesStringFalse WebWebScrapeMdParamsIncludeFramesString = "false"
)

type WebWebScrapeMdParamsIncludeFramesUnion added in v2.5.0

type WebWebScrapeMdParamsIncludeFramesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsIncludeFramesString)
	OfWebWebScrapeMdsIncludeFramesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsIncludeImagesString added in v2.5.0

type WebWebScrapeMdParamsIncludeImagesString string
const (
	WebWebScrapeMdParamsIncludeImagesStringTrue  WebWebScrapeMdParamsIncludeImagesString = "true"
	WebWebScrapeMdParamsIncludeImagesStringFalse WebWebScrapeMdParamsIncludeImagesString = "false"
)

type WebWebScrapeMdParamsIncludeImagesUnion added in v2.5.0

type WebWebScrapeMdParamsIncludeImagesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsIncludeImagesString)
	OfWebWebScrapeMdsIncludeImagesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsIncludeLinksString added in v2.5.0

type WebWebScrapeMdParamsIncludeLinksString string
const (
	WebWebScrapeMdParamsIncludeLinksStringTrue  WebWebScrapeMdParamsIncludeLinksString = "true"
	WebWebScrapeMdParamsIncludeLinksStringFalse WebWebScrapeMdParamsIncludeLinksString = "false"
)

type WebWebScrapeMdParamsIncludeLinksUnion added in v2.5.0

type WebWebScrapeMdParamsIncludeLinksUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsIncludeLinksString)
	OfWebWebScrapeMdsIncludeLinksString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsPdf

type WebWebScrapeMdParamsPdf struct {
	// Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
	// Must be greater than or equal to start when both are provided.
	End param.Opt[int64] `query:"end,omitzero" json:"-"`
	// First 1-based PDF page to parse. When omitted, parsing starts at the first page.
	Start param.Opt[int64] `query:"start,omitzero" json:"-"`
	// When true, detect and OCR images embedded in the selected PDF pages, inserting
	// recognized text at each image's position in page reading order while preserving
	// the PDF text layer. This is separate from automatic scanned-PDF OCR fallback.
	Ocr WebWebScrapeMdParamsPdfOcrUnion `query:"ocr,omitzero" json:"-"`
	// When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
	// a 400 WEBSITE_ACCESS_ERROR is returned.
	ShouldParse WebWebScrapeMdParamsPdfShouldParseUnion `query:"shouldParse,omitzero" json:"-"`
	// contains filtered or unexported fields
}

PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.

func (WebWebScrapeMdParamsPdf) URLQuery

func (r WebWebScrapeMdParamsPdf) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeMdParamsPdf's query parameters as `url.Values`.

type WebWebScrapeMdParamsPdfOcrString added in v2.5.0

type WebWebScrapeMdParamsPdfOcrString string
const (
	WebWebScrapeMdParamsPdfOcrStringTrue  WebWebScrapeMdParamsPdfOcrString = "true"
	WebWebScrapeMdParamsPdfOcrStringFalse WebWebScrapeMdParamsPdfOcrString = "false"
)

type WebWebScrapeMdParamsPdfOcrUnion added in v2.5.0

type WebWebScrapeMdParamsPdfOcrUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsPdfOcrString)
	OfWebWebScrapeMdsPdfOcrString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsPdfShouldParseString added in v2.5.0

type WebWebScrapeMdParamsPdfShouldParseString string
const (
	WebWebScrapeMdParamsPdfShouldParseStringTrue  WebWebScrapeMdParamsPdfShouldParseString = "true"
	WebWebScrapeMdParamsPdfShouldParseStringFalse WebWebScrapeMdParamsPdfShouldParseString = "false"
)

type WebWebScrapeMdParamsPdfShouldParseUnion added in v2.5.0

type WebWebScrapeMdParamsPdfShouldParseUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsPdfShouldParseString)
	OfWebWebScrapeMdsPdfShouldParseString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsSettleAnimationsString added in v2.5.0

type WebWebScrapeMdParamsSettleAnimationsString string
const (
	WebWebScrapeMdParamsSettleAnimationsStringTrue  WebWebScrapeMdParamsSettleAnimationsString = "true"
	WebWebScrapeMdParamsSettleAnimationsStringFalse WebWebScrapeMdParamsSettleAnimationsString = "false"
)

type WebWebScrapeMdParamsSettleAnimationsUnion added in v2.5.0

type WebWebScrapeMdParamsSettleAnimationsUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsSettleAnimationsString)
	OfWebWebScrapeMdsSettleAnimationsString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsShortenBase64ImagesString added in v2.5.0

type WebWebScrapeMdParamsShortenBase64ImagesString string
const (
	WebWebScrapeMdParamsShortenBase64ImagesStringTrue  WebWebScrapeMdParamsShortenBase64ImagesString = "true"
	WebWebScrapeMdParamsShortenBase64ImagesStringFalse WebWebScrapeMdParamsShortenBase64ImagesString = "false"
)

type WebWebScrapeMdParamsShortenBase64ImagesUnion added in v2.5.0

type WebWebScrapeMdParamsShortenBase64ImagesUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsShortenBase64ImagesString)
	OfWebWebScrapeMdsShortenBase64ImagesString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsUseMainContentOnlyString added in v2.5.0

type WebWebScrapeMdParamsUseMainContentOnlyString string
const (
	WebWebScrapeMdParamsUseMainContentOnlyStringTrue  WebWebScrapeMdParamsUseMainContentOnlyString = "true"
	WebWebScrapeMdParamsUseMainContentOnlyStringFalse WebWebScrapeMdParamsUseMainContentOnlyString = "false"
)

type WebWebScrapeMdParamsUseMainContentOnlyUnion added in v2.5.0

type WebWebScrapeMdParamsUseMainContentOnlyUnion struct {
	OfBool param.Opt[bool] `query:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebWebScrapeMdsUseMainContentOnlyString)
	OfWebWebScrapeMdsUseMainContentOnlyString param.Opt[string] `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type WebWebScrapeMdParamsZdr added in v2.5.0

type WebWebScrapeMdParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	WebWebScrapeMdParamsZdrEnabled  WebWebScrapeMdParamsZdr = "enabled"
	WebWebScrapeMdParamsZdrDisabled WebWebScrapeMdParamsZdr = "disabled"
)

type WebWebScrapeMdResponse

type WebWebScrapeMdResponse struct {
	// UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result
	// and compare small values against your workload's minimum useful-content
	// threshold.
	ContentLength int64 `json:"contentLength" api:"required"`
	// Page content converted to GitHub Flavored Markdown
	Markdown string `json:"markdown" api:"required"`
	// Metadata extracted from the scraped page HTML.
	Metadata WebWebScrapeMdResponseMetadata `json:"metadata" api:"required"`
	// Indicates success
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// The URL that was scraped
	URL string `json:"url" api:"required"`
	// One verified outcome per requested browser action, in request order.
	ActionsApplied []WebWebScrapeMdResponseActionsApplied `json:"actionsApplied"`
	// True when an action was applied but the returned content could not be refreshed
	// afterward.
	ActionsHTMLStale bool `json:"actionsHtmlStale"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebWebScrapeMdResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContentLength    respjson.Field
		Markdown         respjson.Field
		Metadata         respjson.Field
		Success          respjson.Field
		URL              respjson.Field
		ActionsApplied   respjson.Field
		ActionsHTMLStale respjson.Field
		KeyMetadata      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeMdResponse) RawJSON

func (r WebWebScrapeMdResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponse) UnmarshalJSON

func (r *WebWebScrapeMdResponse) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseActionsApplied added in v2.6.0

type WebWebScrapeMdResponseActionsApplied struct {
	Instruction string `json:"instruction" api:"required"`
	// Applied means the requested page state was visibly verified. Failed means it was
	// not verified. Skipped means it was not attempted.
	//
	// Any of "applied", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Visible page evidence used to verify an applied action.
	CompletionEvidence string  `json:"completionEvidence"`
	DurationMs         float64 `json:"durationMs"`
	Error              string  `json:"error"`
	Method             string  `json:"method"`
	TargetDescription  string  `json:"targetDescription"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instruction        respjson.Field
		Status             respjson.Field
		CompletionEvidence respjson.Field
		DurationMs         respjson.Field
		Error              respjson.Field
		Method             respjson.Field
		TargetDescription  respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeMdResponseActionsApplied) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseActionsApplied) UnmarshalJSON added in v2.6.0

func (r *WebWebScrapeMdResponseActionsApplied) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseKeyMetadata

type WebWebScrapeMdResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebWebScrapeMdResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseKeyMetadata) UnmarshalJSON

func (r *WebWebScrapeMdResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseMetadata

type WebWebScrapeMdResponseMetadata struct {
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]WebWebScrapeMdResponseMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []WebWebScrapeMdResponseMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]WebWebScrapeMdResponseMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Best title extracted from the page.
	Title string `json:"title"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]WebWebScrapeMdResponseMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Title          respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata extracted from the scraped page HTML.

func (WebWebScrapeMdResponseMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseMetadata) UnmarshalJSON

func (r *WebWebScrapeMdResponseMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseMetadataAdditionalMetaUnion

type WebWebScrapeMdResponseMetadataAdditionalMetaUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeMdResponseMetadataAdditionalMetaUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsString

func (WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsStringArray

func (WebWebScrapeMdResponseMetadataAdditionalMetaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseMetadataAdditionalMetaUnion) UnmarshalJSON

type WebWebScrapeMdResponseMetadataAlternate

type WebWebScrapeMdResponseMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeMdResponseMetadataAlternate) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseMetadataAlternate) UnmarshalJSON

func (r *WebWebScrapeMdResponseMetadataAlternate) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseMetadataOpenGraphUnion

type WebWebScrapeMdResponseMetadataOpenGraphUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeMdResponseMetadataOpenGraphUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeMdResponseMetadataOpenGraphUnion) AsString

func (WebWebScrapeMdResponseMetadataOpenGraphUnion) AsStringArray

func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) AsStringArray() (v []string)

func (WebWebScrapeMdResponseMetadataOpenGraphUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseMetadataOpenGraphUnion) UnmarshalJSON

func (r *WebWebScrapeMdResponseMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error

type WebWebScrapeMdResponseMetadataTwitterUnion

type WebWebScrapeMdResponseMetadataTwitterUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]string] instead of an object.
	OfStringArray []string `json:",inline"`
	JSON          struct {
		OfString      respjson.Field
		OfStringArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebWebScrapeMdResponseMetadataTwitterUnion contains all possible properties and values from [string], [[]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]

func (WebWebScrapeMdResponseMetadataTwitterUnion) AsString

func (WebWebScrapeMdResponseMetadataTwitterUnion) AsStringArray

func (u WebWebScrapeMdResponseMetadataTwitterUnion) AsStringArray() (v []string)

func (WebWebScrapeMdResponseMetadataTwitterUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeMdResponseMetadataTwitterUnion) UnmarshalJSON

func (r *WebWebScrapeMdResponseMetadataTwitterUnion) UnmarshalJSON(data []byte) error

type WebWebScrapeSitemapParams

type WebWebScrapeSitemapParams struct {
	// Domain to build a sitemap for
	Domain string `query:"domain" api:"required" json:"-"`
	// Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
	// Minimum is 1, maximum is 100,000.
	MaxLinks param.Opt[int64] `query:"maxLinks,omitzero" json:"-"`
	// Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
	// instead of discovering the domain's sitemaps.
	SitemapURL param.Opt[string] `query:"sitemapUrl,omitzero" format:"uri" json:"-"`
	// Optional timeout in milliseconds for the request. If the request takes longer
	// than this value, it will be aborted with a 408 status code. Maximum allowed
	// value is 300000ms (5 minutes).
	TimeoutMs param.Opt[int64] `query:"timeoutMS,omitzero" json:"-"`
	// Optional RE2-compatible regex pattern. Only URLs matching this pattern are
	// returned and counted against maxLinks.
	URLRegex param.Opt[string] `query:"urlRegex,omitzero" json:"-"`
	// Optional outbound HTTP headers forwarded only to the target URL, sent as
	// deep-object query params such as headers[X-Custom]=value. When provided, caching
	// is bypassed: the result is neither read from nor written to cache.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// Optional comma-separated caller-defined tags for tracking this request. Tags are
	// recorded on the request's usage log and can be used to filter usage on the
	// dashboard usage page. Up to 20 tags, each 1-50 characters.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Set to enabled to bypass shared caches and omit request and response content
	// from retained usage logs. Requires zero data retention to be enabled for your
	// organization (contact support@context.dev), otherwise the request fails with
	// ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
	//
	// Any of "enabled", "disabled".
	Zdr WebWebScrapeSitemapParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebWebScrapeSitemapParams) URLQuery

func (r WebWebScrapeSitemapParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebWebScrapeSitemapParams's query parameters as `url.Values`.

type WebWebScrapeSitemapParamsZdr added in v2.5.0

type WebWebScrapeSitemapParamsZdr string

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

const (
	WebWebScrapeSitemapParamsZdrEnabled  WebWebScrapeSitemapParamsZdr = "enabled"
	WebWebScrapeSitemapParamsZdrDisabled WebWebScrapeSitemapParamsZdr = "disabled"
)

type WebWebScrapeSitemapResponse

type WebWebScrapeSitemapResponse struct {
	// The normalized domain that was crawled
	Domain string `json:"domain" api:"required"`
	// Metadata about the sitemap crawl operation
	Meta WebWebScrapeSitemapResponseMeta `json:"meta" api:"required"`
	// Indicates success
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// Array of discovered page URLs from the sitemap (max 500)
	URLs []string `json:"urls" api:"required"`
	// Metadata about the API key used for the request. Included in every response
	// whenever a valid API key is provided, even when the response status is not 200.
	KeyMetadata WebWebScrapeSitemapResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		Meta        respjson.Field
		Success     respjson.Field
		URLs        respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebScrapeSitemapResponse) RawJSON

func (r WebWebScrapeSitemapResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebScrapeSitemapResponse) UnmarshalJSON

func (r *WebWebScrapeSitemapResponse) UnmarshalJSON(data []byte) error

type WebWebScrapeSitemapResponseKeyMetadata

type WebWebScrapeSitemapResponseKeyMetadata struct {
	// The number of credits consumed by this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// The number of credits remaining for your organization after this request.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.

func (WebWebScrapeSitemapResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeSitemapResponseKeyMetadata) UnmarshalJSON

func (r *WebWebScrapeSitemapResponseKeyMetadata) UnmarshalJSON(data []byte) error

type WebWebScrapeSitemapResponseMeta

type WebWebScrapeSitemapResponseMeta struct {
	// Number of errors encountered during crawling
	Errors int64 `json:"errors" api:"required"`
	// Total number of sitemap files discovered
	SitemapsDiscovered int64 `json:"sitemapsDiscovered" api:"required"`
	// Number of sitemap files successfully fetched and parsed
	SitemapsFetched int64 `json:"sitemapsFetched" api:"required"`
	// Number of sitemap files skipped (due to errors, timeouts, or limits)
	SitemapsSkipped int64 `json:"sitemapsSkipped" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Errors             respjson.Field
		SitemapsDiscovered respjson.Field
		SitemapsFetched    respjson.Field
		SitemapsSkipped    respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about the sitemap crawl operation

func (WebWebScrapeSitemapResponseMeta) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebScrapeSitemapResponseMeta) UnmarshalJSON

func (r *WebWebScrapeSitemapResponseMeta) UnmarshalJSON(data []byte) error

type WebhookDelivery added in v2.3.0

type WebhookDelivery struct {
	AttemptedAt time.Time            `json:"attempted_at" api:"required" format:"date-time"`
	Error       WebhookDeliveryError `json:"error" api:"required"`
	// The event this delivery carried. Deliveries recorded before event selection
	// existed report change.detected.
	//
	// Any of "change.detected", "run.completed".
	Event WebhookDeliveryEvent `json:"event" api:"required"`
	// Identifier sent in the X-Context-Id header.
	EventID string `json:"event_id" api:"required"`
	// The endpoint's final HTTP response status, or null when no response was
	// received.
	HTTPStatus int64 `json:"http_status" api:"required"`
	// Delivery outcome. delivered means any 2xx response; rejected means a non-2xx
	// response; failed means no HTTP response was received; skipped_unsafe_url means
	// the URL failed the public-endpoint safety check.
	//
	// Any of "delivered", "rejected", "failed", "skipped_unsafe_url".
	Status WebhookDeliveryStatus `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttemptedAt respjson.Field
		Error       respjson.Field
		Event       respjson.Field
		EventID     respjson.Field
		HTTPStatus  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDelivery) RawJSON added in v2.3.0

func (r WebhookDelivery) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDelivery) UnmarshalJSON added in v2.3.0

func (r *WebhookDelivery) UnmarshalJSON(data []byte) error

type WebhookDeliveryError added in v2.3.0

type WebhookDeliveryError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDeliveryError) RawJSON added in v2.3.0

func (r WebhookDeliveryError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDeliveryError) UnmarshalJSON added in v2.3.0

func (r *WebhookDeliveryError) UnmarshalJSON(data []byte) error

type WebhookDeliveryEvent added in v2.3.0

type WebhookDeliveryEvent string

The event this delivery carried. Deliveries recorded before event selection existed report change.detected.

const (
	WebhookDeliveryEventChangeDetected WebhookDeliveryEvent = "change.detected"
	WebhookDeliveryEventRunCompleted   WebhookDeliveryEvent = "run.completed"
)

type WebhookDeliveryStatus added in v2.3.0

type WebhookDeliveryStatus string

Delivery outcome. delivered means any 2xx response; rejected means a non-2xx response; failed means no HTTP response was received; skipped_unsafe_url means the URL failed the public-endpoint safety check.

const (
	WebhookDeliveryStatusDelivered        WebhookDeliveryStatus = "delivered"
	WebhookDeliveryStatusRejected         WebhookDeliveryStatus = "rejected"
	WebhookDeliveryStatusFailed           WebhookDeliveryStatus = "failed"
	WebhookDeliveryStatusSkippedUnsafeURL WebhookDeliveryStatus = "skipped_unsafe_url"
)

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL