Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AIExtractProductParams
- type AIExtractProductResponse
- type AIExtractProductResponseKeyMetadata
- type AIExtractProductResponsePlatform
- type AIExtractProductResponseProduct
- type AIExtractProductsParams
- type AIExtractProductsParamsBodyByDirectURL
- type AIExtractProductsParamsBodyByDomain
- type AIExtractProductsResponse
- type AIExtractProductsResponseKeyMetadata
- type AIExtractProductsResponseProduct
- type AIService
- type BrandGetParams
- type BrandGetParamsBodyByDirectURL
- type BrandGetParamsBodyByDomain
- type BrandGetParamsBodyByEmail
- type BrandGetParamsBodyByName
- type BrandGetParamsBodyByTicker
- type BrandGetParamsBodyByTransaction
- type BrandGetResponse
- type BrandGetResponseBrand
- type BrandGetResponseBrandAddress
- type BrandGetResponseBrandBackdrop
- type BrandGetResponseBrandBackdropColor
- type BrandGetResponseBrandBackdropResolution
- type BrandGetResponseBrandColor
- type BrandGetResponseBrandIndustries
- type BrandGetResponseBrandIndustriesEic
- type BrandGetResponseBrandLinks
- type BrandGetResponseBrandLogo
- type BrandGetResponseBrandLogoColor
- type BrandGetResponseBrandLogoResolution
- type BrandGetResponseBrandSocial
- type BrandGetResponseBrandStock
- type BrandGetResponseKeyMetadata
- type BrandGetSimplifiedParams
- type BrandGetSimplifiedResponse
- type BrandGetSimplifiedResponseBrand
- type BrandGetSimplifiedResponseBrandBackdrop
- type BrandGetSimplifiedResponseBrandBackdropColor
- type BrandGetSimplifiedResponseBrandBackdropResolution
- type BrandGetSimplifiedResponseBrandColor
- type BrandGetSimplifiedResponseBrandLogo
- type BrandGetSimplifiedResponseBrandLogoColor
- type BrandGetSimplifiedResponseBrandLogoResolution
- type BrandGetSimplifiedResponseKeyMetadata
- type BrandService
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Error
- type IndustryGetNaicsParams
- type IndustryGetNaicsResponse
- type IndustryGetNaicsResponseCode
- type IndustryGetNaicsResponseKeyMetadata
- type IndustryGetSicParams
- type IndustryGetSicParamsType
- type IndustryGetSicResponse
- type IndustryGetSicResponseClassification
- type IndustryGetSicResponseCode
- type IndustryGetSicResponseKeyMetadata
- type IndustryService
- type MonitorDeleteResponse
- type MonitorGetChangeResponse
- type MonitorGetChangeResponseChangeDetectionType
- type MonitorGetChangeResponseEvidence
- type MonitorGetChangeResponseImportance
- type MonitorGetChangeResponseMode
- type MonitorGetChangeResponseTargetType
- type MonitorGetResponse
- type MonitorGetResponseBaselineExtractBaseline
- type MonitorGetResponseBaselinePageBaseline
- type MonitorGetResponseBaselineSitemapBaseline
- type MonitorGetResponseBaselineUnion
- func (u MonitorGetResponseBaselineUnion) AsExtractBaseline() (v MonitorGetResponseBaselineExtractBaseline)
- func (u MonitorGetResponseBaselineUnion) AsPageBaseline() (v MonitorGetResponseBaselinePageBaseline)
- func (u MonitorGetResponseBaselineUnion) AsSitemapBaseline() (v MonitorGetResponseBaselineSitemapBaseline)
- func (u MonitorGetResponseBaselineUnion) RawJSON() string
- func (r *MonitorGetResponseBaselineUnion) UnmarshalJSON(data []byte) error
- type MonitorGetResponseChangeDetectionExact
- type MonitorGetResponseChangeDetectionSemantic
- type MonitorGetResponseChangeDetectionUnion
- func (u MonitorGetResponseChangeDetectionUnion) AsAny() anyMonitorGetResponseChangeDetection
- func (u MonitorGetResponseChangeDetectionUnion) AsExact() (v MonitorGetResponseChangeDetectionExact)
- func (u MonitorGetResponseChangeDetectionUnion) AsSemantic() (v MonitorGetResponseChangeDetectionSemantic)
- func (u MonitorGetResponseChangeDetectionUnion) RawJSON() string
- func (r *MonitorGetResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error
- type MonitorGetResponseLastError
- type MonitorGetResponseMode
- type MonitorGetResponseSchedule
- type MonitorGetResponseStatus
- type MonitorGetResponseTargetExtract
- type MonitorGetResponseTargetPage
- type MonitorGetResponseTargetSitemap
- type MonitorGetResponseTargetUnion
- func (u MonitorGetResponseTargetUnion) AsAny() anyMonitorGetResponseTarget
- func (u MonitorGetResponseTargetUnion) AsExtract() (v MonitorGetResponseTargetExtract)
- func (u MonitorGetResponseTargetUnion) AsPage() (v MonitorGetResponseTargetPage)
- func (u MonitorGetResponseTargetUnion) AsSitemap() (v MonitorGetResponseTargetSitemap)
- func (u MonitorGetResponseTargetUnion) RawJSON() string
- func (r *MonitorGetResponseTargetUnion) UnmarshalJSON(data []byte) error
- type MonitorGetResponseWebhook
- type MonitorListAccountChangesParams
- type MonitorListAccountChangesParamsChangeDetectionType
- type MonitorListAccountChangesParamsTargetType
- type MonitorListAccountChangesResponse
- type MonitorListAccountChangesResponseData
- type MonitorListAccountRunsParams
- type MonitorListAccountRunsParamsStatus
- type MonitorListAccountRunsResponse
- type MonitorListAccountRunsResponseData
- type MonitorListAccountRunsResponseDataError
- type MonitorListChangesParams
- type MonitorListChangesResponse
- type MonitorListChangesResponseData
- type MonitorListParams
- type MonitorListParamsChangeDetectionType
- type MonitorListParamsSearchType
- type MonitorListParamsStatus
- type MonitorListParamsTargetType
- type MonitorListResponse
- type MonitorListResponseData
- type MonitorListResponseDataBaselineExtractBaseline
- type MonitorListResponseDataBaselinePageBaseline
- type MonitorListResponseDataBaselineSitemapBaseline
- type MonitorListResponseDataBaselineUnion
- func (u MonitorListResponseDataBaselineUnion) AsExtractBaseline() (v MonitorListResponseDataBaselineExtractBaseline)
- func (u MonitorListResponseDataBaselineUnion) AsPageBaseline() (v MonitorListResponseDataBaselinePageBaseline)
- func (u MonitorListResponseDataBaselineUnion) AsSitemapBaseline() (v MonitorListResponseDataBaselineSitemapBaseline)
- func (u MonitorListResponseDataBaselineUnion) RawJSON() string
- func (r *MonitorListResponseDataBaselineUnion) UnmarshalJSON(data []byte) error
- type MonitorListResponseDataChangeDetectionExact
- type MonitorListResponseDataChangeDetectionSemantic
- type MonitorListResponseDataChangeDetectionUnion
- func (u MonitorListResponseDataChangeDetectionUnion) AsAny() anyMonitorListResponseDataChangeDetection
- func (u MonitorListResponseDataChangeDetectionUnion) AsExact() (v MonitorListResponseDataChangeDetectionExact)
- func (u MonitorListResponseDataChangeDetectionUnion) AsSemantic() (v MonitorListResponseDataChangeDetectionSemantic)
- func (u MonitorListResponseDataChangeDetectionUnion) RawJSON() string
- func (r *MonitorListResponseDataChangeDetectionUnion) UnmarshalJSON(data []byte) error
- type MonitorListResponseDataLastError
- type MonitorListResponseDataSchedule
- type MonitorListResponseDataTargetExtract
- type MonitorListResponseDataTargetPage
- type MonitorListResponseDataTargetSitemap
- type MonitorListResponseDataTargetUnion
- func (u MonitorListResponseDataTargetUnion) AsAny() anyMonitorListResponseDataTarget
- func (u MonitorListResponseDataTargetUnion) AsExtract() (v MonitorListResponseDataTargetExtract)
- func (u MonitorListResponseDataTargetUnion) AsPage() (v MonitorListResponseDataTargetPage)
- func (u MonitorListResponseDataTargetUnion) AsSitemap() (v MonitorListResponseDataTargetSitemap)
- func (u MonitorListResponseDataTargetUnion) RawJSON() string
- func (r *MonitorListResponseDataTargetUnion) UnmarshalJSON(data []byte) error
- type MonitorListResponseDataWebhook
- type MonitorListRunsParams
- type MonitorListRunsParamsStatus
- type MonitorListRunsResponse
- type MonitorListRunsResponseData
- type MonitorListRunsResponseDataError
- type MonitorNewParams
- type MonitorNewParamsChangeDetectionExact
- type MonitorNewParamsChangeDetectionSemantic
- type MonitorNewParamsChangeDetectionUnion
- type MonitorNewParamsMode
- type MonitorNewParamsSchedule
- type MonitorNewParamsTargetExtract
- type MonitorNewParamsTargetPage
- type MonitorNewParamsTargetSitemap
- type MonitorNewParamsTargetUnion
- type MonitorNewParamsWebhook
- type MonitorNewResponse
- type MonitorNewResponseBaselineExtractBaseline
- type MonitorNewResponseBaselinePageBaseline
- type MonitorNewResponseBaselineSitemapBaseline
- type MonitorNewResponseBaselineUnion
- func (u MonitorNewResponseBaselineUnion) AsExtractBaseline() (v MonitorNewResponseBaselineExtractBaseline)
- func (u MonitorNewResponseBaselineUnion) AsPageBaseline() (v MonitorNewResponseBaselinePageBaseline)
- func (u MonitorNewResponseBaselineUnion) AsSitemapBaseline() (v MonitorNewResponseBaselineSitemapBaseline)
- func (u MonitorNewResponseBaselineUnion) RawJSON() string
- func (r *MonitorNewResponseBaselineUnion) UnmarshalJSON(data []byte) error
- type MonitorNewResponseChangeDetectionExact
- type MonitorNewResponseChangeDetectionSemantic
- type MonitorNewResponseChangeDetectionUnion
- func (u MonitorNewResponseChangeDetectionUnion) AsAny() anyMonitorNewResponseChangeDetection
- func (u MonitorNewResponseChangeDetectionUnion) AsExact() (v MonitorNewResponseChangeDetectionExact)
- func (u MonitorNewResponseChangeDetectionUnion) AsSemantic() (v MonitorNewResponseChangeDetectionSemantic)
- func (u MonitorNewResponseChangeDetectionUnion) RawJSON() string
- func (r *MonitorNewResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error
- type MonitorNewResponseLastError
- type MonitorNewResponseMode
- type MonitorNewResponseSchedule
- type MonitorNewResponseStatus
- type MonitorNewResponseTargetExtract
- type MonitorNewResponseTargetPage
- type MonitorNewResponseTargetSitemap
- type MonitorNewResponseTargetUnion
- func (u MonitorNewResponseTargetUnion) AsAny() anyMonitorNewResponseTarget
- func (u MonitorNewResponseTargetUnion) AsExtract() (v MonitorNewResponseTargetExtract)
- func (u MonitorNewResponseTargetUnion) AsPage() (v MonitorNewResponseTargetPage)
- func (u MonitorNewResponseTargetUnion) AsSitemap() (v MonitorNewResponseTargetSitemap)
- func (u MonitorNewResponseTargetUnion) RawJSON() string
- func (r *MonitorNewResponseTargetUnion) UnmarshalJSON(data []byte) error
- type MonitorNewResponseWebhook
- type MonitorRunResponse
- type MonitorService
- func (r *MonitorService) Delete(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)
- func (r *MonitorService) Get(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorGetResponse, err error)
- func (r *MonitorService) GetChange(ctx context.Context, changeID string, opts ...option.RequestOption) (res *MonitorGetChangeResponse, err error)
- func (r *MonitorService) List(ctx context.Context, query MonitorListParams, opts ...option.RequestOption) (res *MonitorListResponse, err error)
- func (r *MonitorService) ListAccountChanges(ctx context.Context, query MonitorListAccountChangesParams, ...) (res *MonitorListAccountChangesResponse, err error)
- func (r *MonitorService) ListAccountRuns(ctx context.Context, query MonitorListAccountRunsParams, ...) (res *MonitorListAccountRunsResponse, err error)
- func (r *MonitorService) ListChanges(ctx context.Context, monitorID string, query MonitorListChangesParams, ...) (res *MonitorListChangesResponse, err error)
- func (r *MonitorService) ListRuns(ctx context.Context, monitorID string, query MonitorListRunsParams, ...) (res *MonitorListRunsResponse, err error)
- func (r *MonitorService) New(ctx context.Context, body MonitorNewParams, opts ...option.RequestOption) (res *MonitorNewResponse, err error)
- func (r *MonitorService) Run(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorRunResponse, err error)
- func (r *MonitorService) Update(ctx context.Context, monitorID string, body MonitorUpdateParams, ...) (res *MonitorUpdateResponse, err error)
- type MonitorUpdateParams
- type MonitorUpdateParamsChangeDetectionExact
- type MonitorUpdateParamsChangeDetectionSemantic
- type MonitorUpdateParamsChangeDetectionUnion
- type MonitorUpdateParamsSchedule
- type MonitorUpdateParamsStatus
- type MonitorUpdateParamsTargetExtract
- type MonitorUpdateParamsTargetPage
- type MonitorUpdateParamsTargetSitemap
- type MonitorUpdateParamsTargetUnion
- type MonitorUpdateParamsWebhook
- type MonitorUpdateResponse
- type MonitorUpdateResponseBaselineExtractBaseline
- type MonitorUpdateResponseBaselinePageBaseline
- type MonitorUpdateResponseBaselineSitemapBaseline
- type MonitorUpdateResponseBaselineUnion
- func (u MonitorUpdateResponseBaselineUnion) AsExtractBaseline() (v MonitorUpdateResponseBaselineExtractBaseline)
- func (u MonitorUpdateResponseBaselineUnion) AsPageBaseline() (v MonitorUpdateResponseBaselinePageBaseline)
- func (u MonitorUpdateResponseBaselineUnion) AsSitemapBaseline() (v MonitorUpdateResponseBaselineSitemapBaseline)
- func (u MonitorUpdateResponseBaselineUnion) RawJSON() string
- func (r *MonitorUpdateResponseBaselineUnion) UnmarshalJSON(data []byte) error
- type MonitorUpdateResponseChangeDetectionExact
- type MonitorUpdateResponseChangeDetectionSemantic
- type MonitorUpdateResponseChangeDetectionUnion
- func (u MonitorUpdateResponseChangeDetectionUnion) AsAny() anyMonitorUpdateResponseChangeDetection
- func (u MonitorUpdateResponseChangeDetectionUnion) AsExact() (v MonitorUpdateResponseChangeDetectionExact)
- func (u MonitorUpdateResponseChangeDetectionUnion) AsSemantic() (v MonitorUpdateResponseChangeDetectionSemantic)
- func (u MonitorUpdateResponseChangeDetectionUnion) RawJSON() string
- func (r *MonitorUpdateResponseChangeDetectionUnion) UnmarshalJSON(data []byte) error
- type MonitorUpdateResponseLastError
- type MonitorUpdateResponseMode
- type MonitorUpdateResponseSchedule
- type MonitorUpdateResponseStatus
- type MonitorUpdateResponseTargetExtract
- type MonitorUpdateResponseTargetPage
- type MonitorUpdateResponseTargetSitemap
- type MonitorUpdateResponseTargetUnion
- func (u MonitorUpdateResponseTargetUnion) AsAny() anyMonitorUpdateResponseTarget
- func (u MonitorUpdateResponseTargetUnion) AsExtract() (v MonitorUpdateResponseTargetExtract)
- func (u MonitorUpdateResponseTargetUnion) AsPage() (v MonitorUpdateResponseTargetPage)
- func (u MonitorUpdateResponseTargetUnion) AsSitemap() (v MonitorUpdateResponseTargetSitemap)
- func (u MonitorUpdateResponseTargetUnion) RawJSON() string
- func (r *MonitorUpdateResponseTargetUnion) UnmarshalJSON(data []byte) error
- type MonitorUpdateResponseWebhook
- type UtilityPrefetchParams
- type UtilityPrefetchParamsIdentifierByDomain
- type UtilityPrefetchParamsIdentifierByEmail
- type UtilityPrefetchParamsIdentifierUnion
- type UtilityPrefetchParamsType
- type UtilityPrefetchResponse
- type UtilityPrefetchResponseKeyMetadata
- type UtilityPrefetchResponseType
- type UtilityService
- type WebExtractCompetitorsParams
- type WebExtractCompetitorsResponse
- type WebExtractCompetitorsResponseCompetitor
- type WebExtractCompetitorsResponseKeyMetadata
- type WebExtractCompetitorsResponseStatus
- type WebExtractCompetitorsResponseTarget
- type WebExtractFontsParams
- type WebExtractFontsResponse
- type WebExtractFontsResponseFont
- type WebExtractFontsResponseFontLink
- type WebExtractFontsResponseKeyMetadata
- type WebExtractParams
- type WebExtractParamsPdf
- type WebExtractResponse
- type WebExtractResponseKeyMetadata
- type WebExtractResponseMetadata
- type WebExtractStyleguideParams
- type WebExtractStyleguideParamsColorScheme
- type WebExtractStyleguideResponse
- type WebExtractStyleguideResponseKeyMetadata
- type WebExtractStyleguideResponseStyleguide
- type WebExtractStyleguideResponseStyleguideColors
- type WebExtractStyleguideResponseStyleguideComponents
- type WebExtractStyleguideResponseStyleguideComponentsButton
- type WebExtractStyleguideResponseStyleguideComponentsButtonLink
- type WebExtractStyleguideResponseStyleguideComponentsButtonPrimary
- type WebExtractStyleguideResponseStyleguideComponentsButtonSecondary
- type WebExtractStyleguideResponseStyleguideComponentsCard
- type WebExtractStyleguideResponseStyleguideElementSpacing
- type WebExtractStyleguideResponseStyleguideFontLink
- type WebExtractStyleguideResponseStyleguideShadows
- type WebExtractStyleguideResponseStyleguideTypography
- type WebExtractStyleguideResponseStyleguideTypographyHeadings
- type WebExtractStyleguideResponseStyleguideTypographyHeadingsH1
- type WebExtractStyleguideResponseStyleguideTypographyHeadingsH2
- type WebExtractStyleguideResponseStyleguideTypographyHeadingsH3
- type WebExtractStyleguideResponseStyleguideTypographyHeadingsH4
- type WebExtractStyleguideResponseStyleguideTypographyP
- type WebScreenshotParams
- type WebScreenshotParamsColorScheme
- type WebScreenshotParamsCountry
- type WebScreenshotParamsFullScreenshot
- type WebScreenshotParamsHandleCookiePopup
- type WebScreenshotParamsPage
- type WebScreenshotParamsViewport
- type WebScreenshotResponse
- type WebScreenshotResponseKeyMetadata
- type WebScreenshotResponseScreenshotType
- type WebSearchParams
- type WebSearchParamsCountry
- type WebSearchParamsFreshness
- type WebSearchParamsMarkdownOptions
- type WebSearchParamsMarkdownOptionsPdf
- type WebSearchResponse
- type WebSearchResponseKeyMetadata
- type WebSearchResponseResult
- type WebSearchResponseResultMarkdown
- type WebService
- func (r *WebService) Extract(ctx context.Context, body WebExtractParams, opts ...option.RequestOption) (res *WebExtractResponse, err error)
- func (r *WebService) ExtractCompetitors(ctx context.Context, query WebExtractCompetitorsParams, ...) (res *WebExtractCompetitorsResponse, err error)
- func (r *WebService) ExtractFonts(ctx context.Context, query WebExtractFontsParams, opts ...option.RequestOption) (res *WebExtractFontsResponse, err error)
- func (r *WebService) ExtractStyleguide(ctx context.Context, query WebExtractStyleguideParams, ...) (res *WebExtractStyleguideResponse, err error)
- func (r *WebService) Screenshot(ctx context.Context, query WebScreenshotParams, opts ...option.RequestOption) (res *WebScreenshotResponse, err error)
- func (r *WebService) Search(ctx context.Context, body WebSearchParams, opts ...option.RequestOption) (res *WebSearchResponse, err error)
- func (r *WebService) WebCrawlMd(ctx context.Context, body WebWebCrawlMdParams, opts ...option.RequestOption) (res *WebWebCrawlMdResponse, err error)
- func (r *WebService) WebScrapeHTML(ctx context.Context, query WebWebScrapeHTMLParams, ...) (res *WebWebScrapeHTMLResponse, err error)
- func (r *WebService) WebScrapeImages(ctx context.Context, query WebWebScrapeImagesParams, ...) (res *WebWebScrapeImagesResponse, err error)
- func (r *WebService) WebScrapeMd(ctx context.Context, query WebWebScrapeMdParams, opts ...option.RequestOption) (res *WebWebScrapeMdResponse, err error)
- func (r *WebService) WebScrapeSitemap(ctx context.Context, query WebWebScrapeSitemapParams, ...) (res *WebWebScrapeSitemapResponse, err error)
- type WebWebCrawlMdParams
- type WebWebCrawlMdParamsCountry
- type WebWebCrawlMdParamsPdf
- type WebWebCrawlMdResponse
- type WebWebCrawlMdResponseKeyMetadata
- type WebWebCrawlMdResponseMetadata
- type WebWebCrawlMdResponseResult
- type WebWebCrawlMdResponseResultMetadata
- type WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion
- func (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsString() (v string)
- func (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsStringArray() (v []string)
- func (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) RawJSON() string
- func (r *WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
- type WebWebCrawlMdResponseResultMetadataAlternate
- type WebWebCrawlMdResponseResultMetadataOpenGraphUnion
- func (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsString() (v string)
- func (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsStringArray() (v []string)
- func (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) RawJSON() string
- func (r *WebWebCrawlMdResponseResultMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error
- type WebWebCrawlMdResponseResultMetadataTwitterUnion
- func (u WebWebCrawlMdResponseResultMetadataTwitterUnion) AsString() (v string)
- func (u WebWebCrawlMdResponseResultMetadataTwitterUnion) AsStringArray() (v []string)
- func (u WebWebCrawlMdResponseResultMetadataTwitterUnion) RawJSON() string
- func (r *WebWebCrawlMdResponseResultMetadataTwitterUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeHTMLParams
- type WebWebScrapeHTMLParamsCountry
- type WebWebScrapeHTMLParamsPdf
- type WebWebScrapeHTMLResponse
- type WebWebScrapeHTMLResponseKeyMetadata
- type WebWebScrapeHTMLResponseMetadata
- type WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion
- func (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsString() (v string)
- func (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsStringArray() (v []string)
- func (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) RawJSON() string
- func (r *WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeHTMLResponseMetadataAlternate
- type WebWebScrapeHTMLResponseMetadataOpenGraphUnion
- func (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsString() (v string)
- func (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsStringArray() (v []string)
- func (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) RawJSON() string
- func (r *WebWebScrapeHTMLResponseMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeHTMLResponseMetadataTwitterUnion
- func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) AsString() (v string)
- func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) AsStringArray() (v []string)
- func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) RawJSON() string
- func (r *WebWebScrapeHTMLResponseMetadataTwitterUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeHTMLResponseType
- type WebWebScrapeImagesParams
- type WebWebScrapeImagesParamsEnrichment
- type WebWebScrapeImagesResponse
- type WebWebScrapeImagesResponseImage
- type WebWebScrapeImagesResponseImageEnrichment
- type WebWebScrapeImagesResponseKeyMetadata
- type WebWebScrapeMdParams
- type WebWebScrapeMdParamsCountry
- type WebWebScrapeMdParamsPdf
- type WebWebScrapeMdResponse
- type WebWebScrapeMdResponseKeyMetadata
- type WebWebScrapeMdResponseMetadata
- type WebWebScrapeMdResponseMetadataAdditionalMetaUnion
- func (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsString() (v string)
- func (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsStringArray() (v []string)
- func (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) RawJSON() string
- func (r *WebWebScrapeMdResponseMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeMdResponseMetadataAlternate
- type WebWebScrapeMdResponseMetadataOpenGraphUnion
- func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) AsString() (v string)
- func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) AsStringArray() (v []string)
- func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) RawJSON() string
- func (r *WebWebScrapeMdResponseMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeMdResponseMetadataTwitterUnion
- func (u WebWebScrapeMdResponseMetadataTwitterUnion) AsString() (v string)
- func (u WebWebScrapeMdResponseMetadataTwitterUnion) AsStringArray() (v []string)
- func (u WebWebScrapeMdResponseMetadataTwitterUnion) RawJSON() string
- func (r *WebWebScrapeMdResponseMetadataTwitterUnion) UnmarshalJSON(data []byte) error
- type WebWebScrapeSitemapParams
- type WebWebScrapeSitemapResponse
- type WebWebScrapeSitemapResponseKeyMetadata
- type WebWebScrapeSitemapResponseMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Opt ¶
func Opt[T comparable](v T) param.Opt[T]
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"`
// 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 ¶
func (r AIExtractProductResponseKeyMetadata) RawJSON() string
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 ¶
func (r AIExtractProductResponseProduct) RawJSON() string
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"`
// 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"`
// 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 ¶
func (r AIExtractProductsResponseKeyMetadata) RawJSON() string
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 ¶
func (r AIExtractProductsResponseProduct) RawJSON() string
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 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"`
// 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"`
// 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"`
// 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"`
// 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"`
// 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 Merchant Category Code (MCC) to help identify the business category or
// industry.
Mcc param.Opt[int64] `json:"mcc,omitzero"`
// Optional phone number from the transaction to help verify brand match.
Phone param.Opt[float64] `json:"phone,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"`
// 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 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"`
// The primary language of the brand's website content. Detected from the HTML lang
// tag, page content analysis, or social media descriptions.
//
// 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 ¶
func (r BrandGetResponseBrandAddress) RawJSON() string
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 ¶
func (r BrandGetResponseBrandBackdrop) RawJSON() string
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 ¶
func (r BrandGetResponseBrandBackdropColor) RawJSON() string
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 ¶
func (r BrandGetResponseBrandBackdropResolution) RawJSON() string
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 ¶
func (r BrandGetResponseBrandIndustries) RawJSON() string
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", "Advertising, Adtech &
// Media Buying", "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", "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 ¶
func (r BrandGetResponseBrandIndustriesEic) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrandGetResponseBrandIndustriesEic) UnmarshalJSON ¶
func (r *BrandGetResponseBrandIndustriesEic) UnmarshalJSON(data []byte) error
type BrandGetResponseBrandLinks ¶
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 ¶
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 ¶
func (r BrandGetResponseBrandLogoColor) RawJSON() string
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 ¶
func (r BrandGetResponseBrandLogoResolution) RawJSON() string
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:"-"`
// 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 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 ¶
func (r BrandGetSimplifiedResponseBrand) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseBrandBackdrop) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseBrandBackdropColor) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseBrandBackdropResolution) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrandGetSimplifiedResponseBrandBackdropResolution) UnmarshalJSON ¶
func (r *BrandGetSimplifiedResponseBrandBackdropResolution) UnmarshalJSON(data []byte) error
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 ¶
func (r BrandGetSimplifiedResponseBrandColor) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrandGetSimplifiedResponseBrandColor) UnmarshalJSON ¶
func (r *BrandGetSimplifiedResponseBrandColor) UnmarshalJSON(data []byte) error
type BrandGetSimplifiedResponseBrandLogo ¶
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 ¶
func (r BrandGetSimplifiedResponseBrandLogo) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseBrandLogoColor) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseBrandLogoResolution) RawJSON() string
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 ¶
func (r BrandGetSimplifiedResponseKeyMetadata) RawJSON() string
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 ¶
func (r *BrandService) GetSimplified(ctx context.Context, query BrandGetSimplifiedParams, opts ...option.RequestOption) (res *BrandGetSimplifiedResponse, err error)
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 {
Web WebService
AI AIService
Brand BrandService
Industry IndustryService
Utility UtilityService
// Monitor pages, sitemaps, and extracted website data for exact or semantic
// changes. The change.detected webhook payload is documented by the
// MonitorsChangeDetectedWebhookPayload schema.
Monitors MonitorService
// 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.
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:"-"`
// 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 ¶
func (r IndustryGetNaicsResponseCode) RawJSON() string
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 ¶
func (r IndustryGetNaicsResponseKeyMetadata) RawJSON() string
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:"-"`
// 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 ¶
func (r IndustryGetSicResponseKeyMetadata) RawJSON() string
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 ¶
func (r *IndustryService) GetNaics(ctx context.Context, query IndustryGetNaicsParams, opts ...option.RequestOption) (res *IndustryGetNaicsResponse, err error)
Classify any brand into 2022 NAICS industry codes from its domain or name.
func (*IndustryService) GetSic ¶
func (r *IndustryService) GetSic(ctx context.Context, query IndustryGetSicParams, opts ...option.RequestOption) (res *IndustryGetSicResponse, err error)
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"`
// 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"`
// User-defined tags for grouping and filtering monitors and their changes.
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
RunID respjson.Field
Summary 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
Tags 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: `query`/`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 ¶
func (r MonitorGetChangeResponseEvidence) RawJSON() string
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 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.
Tags []string `json:"tags"`
Webhook MonitorGetResponseWebhook `json:"webhook" 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
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
func (r MonitorGetResponseBaselineExtractBaseline) RawJSON() string
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
func (r MonitorGetResponseBaselinePageBaseline) RawJSON() string
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
func (r MonitorGetResponseBaselineSitemapBaseline) RawJSON() string
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 (u MonitorGetResponseBaselineUnion) AsExtractBaseline() (v MonitorGetResponseBaselineExtractBaseline)
func (MonitorGetResponseBaselineUnion) AsPageBaseline ¶ added in v2.1.0
func (u MonitorGetResponseBaselineUnion) AsPageBaseline() (v MonitorGetResponseBaselinePageBaseline)
func (MonitorGetResponseBaselineUnion) AsSitemapBaseline ¶ added in v2.1.0
func (u MonitorGetResponseBaselineUnion) AsSitemapBaseline() (v MonitorGetResponseBaselineSitemapBaseline)
func (MonitorGetResponseBaselineUnion) RawJSON ¶ added in v2.1.0
func (u MonitorGetResponseBaselineUnion) RawJSON() string
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 ¶
func (r MonitorGetResponseChangeDetectionExact) RawJSON() string
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
func (MonitorGetResponseChangeDetectionSemantic) RawJSON ¶
func (r MonitorGetResponseChangeDetectionSemantic) RawJSON() string
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 (u MonitorGetResponseChangeDetectionUnion) AsExact() (v MonitorGetResponseChangeDetectionExact)
func (MonitorGetResponseChangeDetectionUnion) AsSemantic ¶
func (u MonitorGetResponseChangeDetectionUnion) AsSemantic() (v MonitorGetResponseChangeDetectionSemantic)
func (MonitorGetResponseChangeDetectionUnion) RawJSON ¶
func (u MonitorGetResponseChangeDetectionUnion) RawJSON() string
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
func (MonitorGetResponseTargetExtract) RawJSON ¶
func (r MonitorGetResponseTargetExtract) RawJSON() string
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"`
// 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
NormalizeWhitespace respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Watch a single web page.
func (MonitorGetResponseTargetPage) RawJSON ¶
func (r MonitorGetResponseTargetPage) RawJSON() string
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.
Exclude []string `json:"exclude"`
// URL path patterns to include.
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 ¶
func (r MonitorGetResponseTargetSitemap) RawJSON() string
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"`
// 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].
Instructions string `json:"instructions"`
// 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
NormalizeWhitespace respjson.Field
Exclude respjson.Field
Include respjson.Field
MaxURLs respjson.Field
Instructions 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 (u MonitorGetResponseTargetUnion) AsExtract() (v MonitorGetResponseTargetExtract)
func (MonitorGetResponseTargetUnion) AsPage ¶
func (u MonitorGetResponseTargetUnion) AsPage() (v MonitorGetResponseTargetPage)
func (MonitorGetResponseTargetUnion) AsSitemap ¶
func (u MonitorGetResponseTargetUnion) AsSitemap() (v MonitorGetResponseTargetSitemap)
func (MonitorGetResponseTargetUnion) RawJSON ¶
func (u MonitorGetResponseTargetUnion) RawJSON() string
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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
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 MonitorListAccountChangesParams ¶
type MonitorListAccountChangesParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
MonitorID param.Opt[string] `query:"monitor_id,omitzero" json:"-"`
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:"-"`
Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
// Any of "exact", "semantic".
ChangeDetectionType MonitorListAccountChangesParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"`
// 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
const ( MonitorListAccountChangesParamsChangeDetectionTypeExact MonitorListAccountChangesParamsChangeDetectionType = "exact" MonitorListAccountChangesParamsChangeDetectionTypeSemantic MonitorListAccountChangesParamsChangeDetectionType = "semantic" )
type MonitorListAccountChangesParamsTargetType ¶
type MonitorListAccountChangesParamsTargetType string
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 ¶
func (r MonitorListAccountChangesResponse) RawJSON() string
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.
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 ¶
func (r MonitorListAccountChangesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListAccountChangesResponseData) UnmarshalJSON ¶
func (r *MonitorListAccountChangesResponseData) UnmarshalJSON(data []byte) error
type MonitorListAccountRunsParams ¶
type MonitorListAccountRunsParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// 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 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
Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor paused, or superseded by a concurrent run).
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 ¶
func (r MonitorListAccountRunsResponse) RawJSON() string
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"`
// 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
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorListAccountRunsResponseData) RawJSON ¶
func (r MonitorListAccountRunsResponseData) RawJSON() string
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 ¶
func (r MonitorListAccountRunsResponseDataError) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListAccountRunsResponseDataError) UnmarshalJSON ¶
func (r *MonitorListAccountRunsResponseDataError) UnmarshalJSON(data []byte) error
type MonitorListChangesParams ¶
type MonitorListChangesParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
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:"-"`
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.
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 ¶
func (r MonitorListChangesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListChangesResponseData) UnmarshalJSON ¶
func (r *MonitorListChangesResponseData) UnmarshalJSON(data []byte) error
type MonitorListParams ¶
type MonitorListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
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:"-"`
// Any of "exact", "semantic".
ChangeDetectionType MonitorListParamsChangeDetectionType `query:"change_detection_type,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:"-"`
// `prefix` for as-you-type prefix matching (default), `exact` for full-token
// matching.
//
// Any of "exact", "prefix".
SearchType MonitorListParamsSearchType `query:"search_type,omitzero" json:"-"`
// 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 MonitorListParamsStatus `query:"status,omitzero" json:"-"`
// Comma-separated list of tags to filter by (matches monitors having any of them).
Tags []string `query:"tags,omitzero" json:"-"`
// 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
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
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 ( MonitorListParamsStatusActive MonitorListParamsStatus = "active" MonitorListParamsStatusPaused MonitorListParamsStatus = "paused" MonitorListParamsStatusFailed MonitorListParamsStatus = "failed" )
type MonitorListParamsTargetType ¶
type MonitorListParamsTargetType string
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.
Tags []string `json:"tags"`
Webhook MonitorListResponseDataWebhook `json:"webhook" 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
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
func (r MonitorListResponseDataBaselineExtractBaseline) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListResponseDataBaselineExtractBaseline) UnmarshalJSON ¶ added in v2.1.0
func (r *MonitorListResponseDataBaselineExtractBaseline) UnmarshalJSON(data []byte) error
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
func (r MonitorListResponseDataBaselinePageBaseline) RawJSON() string
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
func (r MonitorListResponseDataBaselineSitemapBaseline) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON ¶ added in v2.1.0
func (r *MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON(data []byte) error
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 (u MonitorListResponseDataBaselineUnion) AsExtractBaseline() (v MonitorListResponseDataBaselineExtractBaseline)
func (MonitorListResponseDataBaselineUnion) AsPageBaseline ¶ added in v2.1.0
func (u MonitorListResponseDataBaselineUnion) AsPageBaseline() (v MonitorListResponseDataBaselinePageBaseline)
func (MonitorListResponseDataBaselineUnion) AsSitemapBaseline ¶ added in v2.1.0
func (u MonitorListResponseDataBaselineUnion) AsSitemapBaseline() (v MonitorListResponseDataBaselineSitemapBaseline)
func (MonitorListResponseDataBaselineUnion) RawJSON ¶ added in v2.1.0
func (u MonitorListResponseDataBaselineUnion) RawJSON() string
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 ¶
func (r MonitorListResponseDataChangeDetectionExact) RawJSON() string
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
func (MonitorListResponseDataChangeDetectionSemantic) RawJSON ¶
func (r MonitorListResponseDataChangeDetectionSemantic) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListResponseDataChangeDetectionSemantic) UnmarshalJSON ¶
func (r *MonitorListResponseDataChangeDetectionSemantic) UnmarshalJSON(data []byte) error
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 (u MonitorListResponseDataChangeDetectionUnion) AsExact() (v MonitorListResponseDataChangeDetectionExact)
func (MonitorListResponseDataChangeDetectionUnion) AsSemantic ¶
func (u MonitorListResponseDataChangeDetectionUnion) AsSemantic() (v MonitorListResponseDataChangeDetectionSemantic)
func (MonitorListResponseDataChangeDetectionUnion) RawJSON ¶
func (u MonitorListResponseDataChangeDetectionUnion) RawJSON() string
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 ¶
func (r MonitorListResponseDataLastError) RawJSON() string
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 ¶
func (r MonitorListResponseDataSchedule) RawJSON() string
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
func (MonitorListResponseDataTargetExtract) RawJSON ¶
func (r MonitorListResponseDataTargetExtract) RawJSON() string
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"`
// 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
NormalizeWhitespace respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Watch a single web page.
func (MonitorListResponseDataTargetPage) RawJSON ¶
func (r MonitorListResponseDataTargetPage) RawJSON() string
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.
Exclude []string `json:"exclude"`
// URL path patterns to include.
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 ¶
func (r MonitorListResponseDataTargetSitemap) RawJSON() string
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"`
// 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].
Instructions string `json:"instructions"`
// 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
NormalizeWhitespace respjson.Field
Exclude respjson.Field
Include respjson.Field
MaxURLs respjson.Field
Instructions 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 (u MonitorListResponseDataTargetUnion) AsExtract() (v MonitorListResponseDataTargetExtract)
func (MonitorListResponseDataTargetUnion) AsPage ¶
func (u MonitorListResponseDataTargetUnion) AsPage() (v MonitorListResponseDataTargetPage)
func (MonitorListResponseDataTargetUnion) AsSitemap ¶
func (u MonitorListResponseDataTargetUnion) AsSitemap() (v MonitorListResponseDataTargetSitemap)
func (MonitorListResponseDataTargetUnion) RawJSON ¶
func (u MonitorListResponseDataTargetUnion) RawJSON() string
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorListResponseDataWebhook) RawJSON ¶
func (r MonitorListResponseDataWebhook) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListResponseDataWebhook) UnmarshalJSON ¶
func (r *MonitorListResponseDataWebhook) UnmarshalJSON(data []byte) error
type MonitorListRunsParams ¶
type MonitorListRunsParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// 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 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
Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor paused, or superseded by a concurrent run).
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"`
// 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
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 ¶
func (r MonitorListRunsResponseDataError) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListRunsResponseDataError) UnmarshalJSON ¶
func (r *MonitorListRunsResponseDataError) UnmarshalJSON(data []byte) error
type MonitorNewParams ¶
type MonitorNewParams struct {
// Discriminated union describing how changes are detected.
ChangeDetection MonitorNewParamsChangeDetectionUnion `json:"change_detection,omitzero" 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 MonitorNewParamsSchedule `json:"schedule,omitzero" api:"required"`
// Discriminated union describing what the monitor watches.
Target MonitorNewParamsTargetUnion `json:"target,omitzero" api:"required"`
Webhook MonitorNewParamsWebhook `json:"webhook,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"`
// User-defined tags for grouping and filtering monitors and their changes.
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. 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"`
// 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.
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.
Exclude []string `json:"exclude,omitzero"`
// URL path patterns to include.
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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"`
// 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.
Tags []string `json:"tags"`
Webhook MonitorNewResponseWebhook `json:"webhook" 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
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 (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
func (r MonitorNewResponseBaselineExtractBaseline) RawJSON() string
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
func (r MonitorNewResponseBaselinePageBaseline) RawJSON() string
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
func (r MonitorNewResponseBaselineSitemapBaseline) RawJSON() string
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 (u MonitorNewResponseBaselineUnion) AsExtractBaseline() (v MonitorNewResponseBaselineExtractBaseline)
func (MonitorNewResponseBaselineUnion) AsPageBaseline ¶ added in v2.1.0
func (u MonitorNewResponseBaselineUnion) AsPageBaseline() (v MonitorNewResponseBaselinePageBaseline)
func (MonitorNewResponseBaselineUnion) AsSitemapBaseline ¶ added in v2.1.0
func (u MonitorNewResponseBaselineUnion) AsSitemapBaseline() (v MonitorNewResponseBaselineSitemapBaseline)
func (MonitorNewResponseBaselineUnion) RawJSON ¶ added in v2.1.0
func (u MonitorNewResponseBaselineUnion) RawJSON() string
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 ¶
func (r MonitorNewResponseChangeDetectionExact) RawJSON() string
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
func (MonitorNewResponseChangeDetectionSemantic) RawJSON ¶
func (r MonitorNewResponseChangeDetectionSemantic) RawJSON() string
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 (u MonitorNewResponseChangeDetectionUnion) AsExact() (v MonitorNewResponseChangeDetectionExact)
func (MonitorNewResponseChangeDetectionUnion) AsSemantic ¶
func (u MonitorNewResponseChangeDetectionUnion) AsSemantic() (v MonitorNewResponseChangeDetectionSemantic)
func (MonitorNewResponseChangeDetectionUnion) RawJSON ¶
func (u MonitorNewResponseChangeDetectionUnion) RawJSON() string
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
func (MonitorNewResponseTargetExtract) RawJSON ¶
func (r MonitorNewResponseTargetExtract) RawJSON() string
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"`
// 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
NormalizeWhitespace respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Watch a single web page.
func (MonitorNewResponseTargetPage) RawJSON ¶
func (r MonitorNewResponseTargetPage) RawJSON() string
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.
Exclude []string `json:"exclude"`
// URL path patterns to include.
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 ¶
func (r MonitorNewResponseTargetSitemap) RawJSON() string
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"`
// 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].
Instructions string `json:"instructions"`
// 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
NormalizeWhitespace respjson.Field
Exclude respjson.Field
Include respjson.Field
MaxURLs respjson.Field
Instructions 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 (u MonitorNewResponseTargetUnion) AsExtract() (v MonitorNewResponseTargetExtract)
func (MonitorNewResponseTargetUnion) AsPage ¶
func (u MonitorNewResponseTargetUnion) AsPage() (v MonitorNewResponseTargetPage)
func (MonitorNewResponseTargetUnion) AsSitemap ¶
func (u MonitorNewResponseTargetUnion) AsSitemap() (v MonitorNewResponseTargetSitemap)
func (MonitorNewResponseTargetUnion) RawJSON ¶
func (u MonitorNewResponseTargetUnion) RawJSON() string
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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
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 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. The change.detected webhook payload is documented by the MonitorsChangeDetectedWebhookPayload schema.
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) List ¶
func (r *MonitorService) List(ctx context.Context, query MonitorListParams, opts ...option.RequestOption) (res *MonitorListResponse, err error)
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 ¶
func (r *MonitorService) ListAccountChanges(ctx context.Context, query MonitorListAccountChangesParams, opts ...option.RequestOption) (res *MonitorListAccountChangesResponse, err error)
Returns an account-wide feed of detected changes across monitors.
func (*MonitorService) ListAccountRuns ¶
func (r *MonitorService) ListAccountRuns(ctx context.Context, query MonitorListAccountRunsParams, opts ...option.RequestOption) (res *MonitorListAccountRunsResponse, err error)
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 ¶
func (r *MonitorService) New(ctx context.Context, body MonitorNewParams, opts ...option.RequestOption) (res *MonitorNewResponse, err error)
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.
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. 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"`
// 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.
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.
Exclude []string `json:"exclude,omitzero"`
// URL path patterns to include.
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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.
Tags []string `json:"tags"`
Webhook MonitorUpdateResponseWebhook `json:"webhook" 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
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
func (r MonitorUpdateResponseBaselineExtractBaseline) RawJSON() string
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
func (r MonitorUpdateResponseBaselinePageBaseline) RawJSON() string
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
func (r MonitorUpdateResponseBaselineSitemapBaseline) RawJSON() string
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 (u MonitorUpdateResponseBaselineUnion) AsExtractBaseline() (v MonitorUpdateResponseBaselineExtractBaseline)
func (MonitorUpdateResponseBaselineUnion) AsPageBaseline ¶ added in v2.1.0
func (u MonitorUpdateResponseBaselineUnion) AsPageBaseline() (v MonitorUpdateResponseBaselinePageBaseline)
func (MonitorUpdateResponseBaselineUnion) AsSitemapBaseline ¶ added in v2.1.0
func (u MonitorUpdateResponseBaselineUnion) AsSitemapBaseline() (v MonitorUpdateResponseBaselineSitemapBaseline)
func (MonitorUpdateResponseBaselineUnion) RawJSON ¶ added in v2.1.0
func (u MonitorUpdateResponseBaselineUnion) RawJSON() string
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 ¶
func (r MonitorUpdateResponseChangeDetectionExact) RawJSON() string
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 the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
func (MonitorUpdateResponseChangeDetectionSemantic) RawJSON ¶
func (r MonitorUpdateResponseChangeDetectionSemantic) RawJSON() string
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 (u MonitorUpdateResponseChangeDetectionUnion) AsExact() (v MonitorUpdateResponseChangeDetectionExact)
func (MonitorUpdateResponseChangeDetectionUnion) AsSemantic ¶
func (u MonitorUpdateResponseChangeDetectionUnion) AsSemantic() (v MonitorUpdateResponseChangeDetectionSemantic)
func (MonitorUpdateResponseChangeDetectionUnion) RawJSON ¶
func (u MonitorUpdateResponseChangeDetectionUnion) RawJSON() string
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 ¶
func (r MonitorUpdateResponseLastError) RawJSON() string
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 ¶
func (r MonitorUpdateResponseSchedule) RawJSON() string
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 guides which pages are
// selected for tracking and gives the change judge context on what matters. 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
func (MonitorUpdateResponseTargetExtract) RawJSON ¶
func (r MonitorUpdateResponseTargetExtract) RawJSON() string
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"`
// 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
NormalizeWhitespace respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Watch a single web page.
func (MonitorUpdateResponseTargetPage) RawJSON ¶
func (r MonitorUpdateResponseTargetPage) RawJSON() string
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.
Exclude []string `json:"exclude"`
// URL path patterns to include.
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 ¶
func (r MonitorUpdateResponseTargetSitemap) RawJSON() string
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"`
// 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].
Instructions string `json:"instructions"`
// 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
NormalizeWhitespace respjson.Field
Exclude respjson.Field
Include respjson.Field
MaxURLs respjson.Field
Instructions 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 (u MonitorUpdateResponseTargetUnion) AsExtract() (v MonitorUpdateResponseTargetExtract)
func (MonitorUpdateResponseTargetUnion) AsPage ¶
func (u MonitorUpdateResponseTargetUnion) AsPage() (v MonitorUpdateResponseTargetPage)
func (MonitorUpdateResponseTargetUnion) AsSitemap ¶
func (u MonitorUpdateResponseTargetUnion) AsSitemap() (v MonitorUpdateResponseTargetSitemap)
func (MonitorUpdateResponseTargetUnion) RawJSON ¶
func (u MonitorUpdateResponseTargetUnion) RawJSON() string
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 called when a change is detected.
URL string `json:"url" api:"required" format:"uri"`
// 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
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorUpdateResponseWebhook) RawJSON ¶
func (r MonitorUpdateResponseWebhook) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorUpdateResponseWebhook) UnmarshalJSON ¶
func (r *MonitorUpdateResponseWebhook) UnmarshalJSON(data []byte) error
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"`
// 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 ¶
func (r UtilityPrefetchResponseKeyMetadata) RawJSON() string
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 ¶
func (r *UtilityService) Prefetch(ctx context.Context, body UtilityPrefetchParams, opts ...option.RequestOption) (res *UtilityPrefetchResponse, err error)
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:"-"`
// 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 ¶
func (r WebExtractCompetitorsResponse) RawJSON() string
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 ¶
func (r WebExtractCompetitorsResponseCompetitor) RawJSON() string
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 ¶
func (r WebExtractCompetitorsResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebExtractCompetitorsResponseTarget) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractCompetitorsResponseTarget) UnmarshalJSON ¶
func (r *WebExtractCompetitorsResponseTarget) UnmarshalJSON(data []byte) error
type WebExtractFontsParams ¶
type WebExtractFontsParams struct {
// 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:"-"`
// Maximum age in milliseconds for cached 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:"-"`
// 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 ¶
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 ¶
func (r WebExtractFontsResponseFontLink) RawJSON() string
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 ¶
func (r WebExtractFontsResponseKeyMetadata) RawJSON() string
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"`
// 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"`
// 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 ¶
func (r WebExtractResponseKeyMetadata) RawJSON() string
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 {
// 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:"-"`
// Maximum age in milliseconds for cached 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 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:"-"`
// 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 ¶
func (r WebExtractStyleguideResponse) RawJSON() string
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 ¶
func (r WebExtractStyleguideResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebExtractStyleguideResponseStyleguide) RawJSON() string
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 ¶
func (r WebExtractStyleguideResponseStyleguideColors) RawJSON() string
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponents) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponents) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponents) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponentsButton) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponentsButton) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponentsButton) UnmarshalJSON(data []byte) error
type WebExtractStyleguideResponseStyleguideComponentsButtonLink ¶
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponentsButtonLink) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponentsButtonLink) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponentsButtonLink) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideComponentsCard) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideComponentsCard) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideComponentsCard) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideElementSpacing) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideElementSpacing) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideElementSpacing) UnmarshalJSON(data []byte) error
type WebExtractStyleguideResponseStyleguideFontLink ¶
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 ¶
func (r WebExtractStyleguideResponseStyleguideFontLink) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideFontLink) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideFontLink) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideShadows) RawJSON() string
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypography) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypography) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypography) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyHeadings) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyHeadings) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyHeadings) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) UnmarshalJSON(data []byte) error
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 ¶
func (r WebExtractStyleguideResponseStyleguideTypographyP) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebExtractStyleguideResponseStyleguideTypographyP) UnmarshalJSON ¶
func (r *WebExtractStyleguideResponseStyleguideTypographyP) UnmarshalJSON(data []byte) error
type WebScreenshotParams ¶
type WebScreenshotParams struct {
// 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:"-"`
// 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 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 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:"-"`
// 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 for the website request location.
// 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.
//
// Any of "true", "false".
HandleCookiePopup WebScreenshotParamsHandleCookiePopup `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 browser viewport dimensions for the screenshot. Defaults to 1920x1080.
Viewport WebScreenshotParamsViewport `query:"viewport,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 for the website request location. 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 WebScreenshotParamsHandleCookiePopup ¶
type WebScreenshotParamsHandleCookiePopup string
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.
const ( WebScreenshotParamsHandleCookiePopupTrue WebScreenshotParamsHandleCookiePopup = "true" WebScreenshotParamsHandleCookiePopupFalse WebScreenshotParamsHandleCookiePopup = "false" )
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 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 URL of the uploaded screenshot image
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 ¶
func (r WebScreenshotResponseKeyMetadata) RawJSON() string
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"`
// 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 ¶
func (r WebSearchResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebSearchResponseResultMarkdown) RawJSON() string
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.
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. When enrichment is enabled, the entire call costs 5 credits.
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.
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 OCR to an
// inclusive 1-based page range.
Pdf WebWebCrawlMdParamsPdf `json:"pdf,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, 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 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 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 ¶
func (r WebWebCrawlMdResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebWebCrawlMdResponseMetadata) RawJSON() string
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 ¶
func (r WebWebCrawlMdResponseResultMetadata) RawJSON() string
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 (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsString() (v string)
func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsStringArray ¶
func (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsStringArray() (v []string)
func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) RawJSON ¶
func (u WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) UnmarshalJSON ¶
func (r *WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r WebWebCrawlMdResponseResultMetadataAlternate) RawJSON() string
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 (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsString() (v string)
func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsStringArray ¶
func (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsStringArray() (v []string)
func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) RawJSON ¶
func (u WebWebCrawlMdResponseResultMetadataOpenGraphUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebCrawlMdResponseResultMetadataOpenGraphUnion) UnmarshalJSON ¶
func (r *WebWebCrawlMdResponseResultMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error
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 (u WebWebCrawlMdResponseResultMetadataTwitterUnion) AsString() (v string)
func (WebWebCrawlMdResponseResultMetadataTwitterUnion) AsStringArray ¶
func (u WebWebCrawlMdResponseResultMetadataTwitterUnion) AsStringArray() (v []string)
func (WebWebCrawlMdResponseResultMetadataTwitterUnion) RawJSON ¶
func (u WebWebCrawlMdResponseResultMetadataTwitterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebCrawlMdResponseResultMetadataTwitterUnion) UnmarshalJSON ¶
func (r *WebWebCrawlMdResponseResultMetadataTwitterUnion) UnmarshalJSON(data []byte) error
type WebWebScrapeHTMLParams ¶
type WebWebScrapeHTMLParams struct {
// Full URL to scrape (must include http:// or https:// protocol)
URL string `query:"url" api:"required" format:"uri" json:"-"`
// When true, iframes are rendered inline into the returned HTML.
IncludeFrames param.Opt[bool] `query:"includeFrames,omitzero" 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:"-"`
// 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 param.Opt[bool] `query:"settleAnimations,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:"-"`
// When true, return only the page's main content in the HTML response, excluding
// headers, footers, sidebars, and navigation when detectable.
UseMainContentOnly param.Opt[bool] `query:"useMainContentOnly,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:"-"`
// Two-letter ISO 3166-1 alpha-2 country code for the website request location.
// 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:"-"`
// 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:"-"`
// 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:"-"`
// 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:"-"`
// PDF parsing controls. Use start/end to limit text extraction and OCR to an
// inclusive 1-based page range.
Pdf WebWebScrapeHTMLParamsPdf `query:"pdf,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 WebWebScrapeHTMLParamsCountry ¶
type WebWebScrapeHTMLParamsCountry string
Two-letter ISO 3166-1 alpha-2 country code for the website request location. 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 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:"-"`
// When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
// a 400 WEBSITE_ACCESS_ERROR is returned.
ShouldParse param.Opt[bool] `query:"shouldParse,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 parsing controls. Use start/end to limit text extraction and 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 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"`
// 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
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 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 ¶
func (r WebWebScrapeHTMLResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebWebScrapeHTMLResponseMetadata) RawJSON() string
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 (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsString() (v string)
func (WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsStringArray ¶
func (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) AsStringArray() (v []string)
func (WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) RawJSON ¶
func (u WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) UnmarshalJSON ¶
func (r *WebWebScrapeHTMLResponseMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r WebWebScrapeHTMLResponseMetadataAlternate) RawJSON() string
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 (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsString() (v string)
func (WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsStringArray ¶
func (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) AsStringArray() (v []string)
func (WebWebScrapeHTMLResponseMetadataOpenGraphUnion) RawJSON ¶
func (u WebWebScrapeHTMLResponseMetadataOpenGraphUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebScrapeHTMLResponseMetadataOpenGraphUnion) UnmarshalJSON ¶
func (r *WebWebScrapeHTMLResponseMetadataOpenGraphUnion) UnmarshalJSON(data []byte) error
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 (u WebWebScrapeHTMLResponseMetadataTwitterUnion) AsString() (v string)
func (WebWebScrapeHTMLResponseMetadataTwitterUnion) AsStringArray ¶
func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) AsStringArray() (v []string)
func (WebWebScrapeHTMLResponseMetadataTwitterUnion) RawJSON ¶
func (u WebWebScrapeHTMLResponseMetadataTwitterUnion) RawJSON() string
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:"-"`
// 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 param.Opt[bool] `query:"dedupe,omitzero" 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 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 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 per-image processing, sent as deep-object query params such as
// enrichment[resolution]=true.
Enrichment WebWebScrapeImagesParamsEnrichment `query:"enrichment,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:"-"`
// 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 WebWebScrapeImagesParamsEnrichment ¶
type WebWebScrapeImagesParamsEnrichment struct {
// Classify each image by visual asset type.
Classification param.Opt[bool] `query:"classification,omitzero" json:"-"`
// Host materializable images on the Brand.dev CDN and return their URL and MIME
// type.
HostedURL param.Opt[bool] `query:"hostedUrl,omitzero" json:"-"`
// Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
MaxTimePerMs param.Opt[int64] `query:"maxTimePerMs,omitzero" json:"-"`
// Measure image width and height when possible.
Resolution param.Opt[bool] `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 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 ¶
func (r WebWebScrapeImagesResponseImage) RawJSON() string
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 ¶
func (r WebWebScrapeImagesResponseImageEnrichment) RawJSON() string
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 ¶
func (r WebWebScrapeImagesResponseKeyMetadata) RawJSON() string
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:"-"`
// When true, the contents of iframes are rendered to Markdown.
IncludeFrames param.Opt[bool] `query:"includeFrames,omitzero" json:"-"`
// Include image references in Markdown output
IncludeImages param.Opt[bool] `query:"includeImages,omitzero" json:"-"`
// Preserve hyperlinks in Markdown output
IncludeLinks param.Opt[bool] `query:"includeLinks,omitzero" 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:"-"`
// 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 param.Opt[bool] `query:"settleAnimations,omitzero" json:"-"`
// Shorten base64-encoded image data in the Markdown output
ShortenBase64Images param.Opt[bool] `query:"shortenBase64Images,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:"-"`
// Extract only the main content of the page, excluding headers, footers, sidebars,
// and navigation
UseMainContentOnly param.Opt[bool] `query:"useMainContentOnly,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:"-"`
// Two-letter ISO 3166-1 alpha-2 country code for the website request location.
// 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:"-"`
// 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:"-"`
// 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:"-"`
// 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:"-"`
// PDF parsing controls. Use start/end to limit text extraction and OCR to an
// inclusive 1-based page range.
Pdf WebWebScrapeMdParamsPdf `query:"pdf,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 WebWebScrapeMdParamsCountry ¶
type WebWebScrapeMdParamsCountry string
Two-letter ISO 3166-1 alpha-2 country code for the website request location. 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 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:"-"`
// When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
// a 400 WEBSITE_ACCESS_ERROR is returned.
ShouldParse param.Opt[bool] `query:"shouldParse,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 parsing controls. Use start/end to limit text extraction and 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 WebWebScrapeMdResponse ¶
type WebWebScrapeMdResponse struct {
// 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"`
// 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 {
Markdown respjson.Field
Metadata respjson.Field
Success respjson.Field
URL 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 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 ¶
func (r WebWebScrapeMdResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebWebScrapeMdResponseMetadata) RawJSON() string
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 (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsString() (v string)
func (WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsStringArray ¶
func (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) AsStringArray() (v []string)
func (WebWebScrapeMdResponseMetadataAdditionalMetaUnion) RawJSON ¶
func (u WebWebScrapeMdResponseMetadataAdditionalMetaUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebScrapeMdResponseMetadataAdditionalMetaUnion) UnmarshalJSON ¶
func (r *WebWebScrapeMdResponseMetadataAdditionalMetaUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r WebWebScrapeMdResponseMetadataAlternate) RawJSON() string
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 (u WebWebScrapeMdResponseMetadataOpenGraphUnion) AsString() (v string)
func (WebWebScrapeMdResponseMetadataOpenGraphUnion) AsStringArray ¶
func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) AsStringArray() (v []string)
func (WebWebScrapeMdResponseMetadataOpenGraphUnion) RawJSON ¶
func (u WebWebScrapeMdResponseMetadataOpenGraphUnion) RawJSON() string
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 (u WebWebScrapeMdResponseMetadataTwitterUnion) AsString() (v string)
func (WebWebScrapeMdResponseMetadataTwitterUnion) AsStringArray ¶
func (u WebWebScrapeMdResponseMetadataTwitterUnion) AsStringArray() (v []string)
func (WebWebScrapeMdResponseMetadataTwitterUnion) RawJSON ¶
func (u WebWebScrapeMdResponseMetadataTwitterUnion) RawJSON() string
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 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:"-"`
// 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 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 ¶
func (r WebWebScrapeSitemapResponseKeyMetadata) RawJSON() string
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 ¶
func (r WebWebScrapeSitemapResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebWebScrapeSitemapResponseMeta) UnmarshalJSON ¶
func (r *WebWebScrapeSitemapResponseMeta) UnmarshalJSON(data []byte) error
Source Files
¶
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
|
|