Documentation
¶
Index ¶
- type BatchOptions
- type BrandResult
- type Client
- func (c *Client) Batch(ctx context.Context, urls []string, opts *BatchOptions, wait *WaitOptions) (*Job, error)
- func (c *Client) BatchStatus(ctx context.Context, id string) (*Job, error)
- func (c *Client) Brand(ctx context.Context, domain string) (BrandResult, error)
- func (c *Client) Crawl(ctx context.Context, rawURL string, opts *CrawlOptions, wait *WaitOptions) (*Job, error)
- func (c *Client) CrawlStatus(ctx context.Context, id string) (*Job, error)
- func (c *Client) Extract(ctx context.Context, urls []string, opts *ExtractOptions) (*ExtractResult, error)
- func (c *Client) Images(ctx context.Context, rawURL string) (*ImagesResult, error)
- func (c *Client) Logo(ctx context.Context, domain string, opts *LogoOptions) (BrandResult, error)
- func (c *Client) Map(ctx context.Context, rawURL string, opts *MapOptions) (*MapResult, error)
- func (c *Client) Markdown(ctx context.Context, rawURL string) (string, error)
- func (c *Client) Scrape(ctx context.Context, rawURL string, opts *ScrapeOptions) (*ScrapeResult, error)
- func (c *Client) Screenshot(ctx context.Context, rawURL string, opts *ScreenshotOptions) (*ScreenshotResult, error)
- func (c *Client) Search(ctx context.Context, query string, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) StartBatch(ctx context.Context, urls []string, opts *BatchOptions) (string, error)
- func (c *Client) StartCrawl(ctx context.Context, rawURL string, opts *CrawlOptions) (string, error)
- func (c *Client) Styleguide(ctx context.Context, domain string) (BrandResult, error)
- type CrawlOptions
- type Error
- type ExtractItem
- type ExtractOptions
- type ExtractResult
- type Format
- type ImagesResult
- type Job
- type JobPage
- type LogoOptions
- type MapOptions
- type MapResult
- type Metadata
- type Option
- type PageImage
- type ScrapeOptions
- type ScrapeResult
- type ScreenshotOptions
- type ScreenshotResult
- type SearchItem
- type SearchOptions
- type SearchResult
- type Usage
- type WaitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchOptions ¶
type BatchOptions struct {
Webhook string `json:"webhook,omitempty"`
ScrapeOptions *ScrapeOptions `json:"scrapeOptions,omitempty"`
}
type BrandResult ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Batch ¶
func (c *Client) Batch(ctx context.Context, urls []string, opts *BatchOptions, wait *WaitOptions) (*Job, error)
func (*Client) BatchStatus ¶
func (*Client) Crawl ¶
func (c *Client) Crawl(ctx context.Context, rawURL string, opts *CrawlOptions, wait *WaitOptions) (*Job, error)
func (*Client) CrawlStatus ¶
func (*Client) Extract ¶
func (c *Client) Extract(ctx context.Context, urls []string, opts *ExtractOptions) (*ExtractResult, error)
func (*Client) Logo ¶
func (c *Client) Logo(ctx context.Context, domain string, opts *LogoOptions) (BrandResult, error)
func (*Client) Scrape ¶
func (c *Client) Scrape(ctx context.Context, rawURL string, opts *ScrapeOptions) (*ScrapeResult, error)
func (*Client) Screenshot ¶
func (c *Client) Screenshot(ctx context.Context, rawURL string, opts *ScreenshotOptions) (*ScreenshotResult, error)
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, query string, opts *SearchOptions) (*SearchResult, error)
func (*Client) StartBatch ¶
func (*Client) StartCrawl ¶
func (*Client) Styleguide ¶
type CrawlOptions ¶
type CrawlOptions struct {
Limit int `json:"limit,omitempty"`
MaxDepth int `json:"maxDepth,omitempty"`
IncludePaths []string `json:"includePaths,omitempty"`
ExcludePaths []string `json:"excludePaths,omitempty"`
AllowSubdomains bool `json:"allowSubdomains,omitempty"`
Webhook string `json:"webhook,omitempty"`
ScrapeOptions *ScrapeOptions `json:"scrapeOptions,omitempty"`
}
type Error ¶
func (*Error) IsInvalidRequest ¶
func (*Error) IsOutOfCredits ¶
func (*Error) IsRetryable ¶
type ExtractItem ¶
type ExtractOptions ¶
type ExtractOptions struct {
Schema map[string]any `json:"schema,omitempty"`
Prompt string `json:"prompt,omitempty"`
PreferStructure bool `json:"preferStructure,omitempty"`
EnableWebSearch bool `json:"enableWebSearch,omitempty"`
ShowSources bool `json:"showSources,omitempty"`
ShowConfidence bool `json:"showConfidence,omitempty"`
MergeEntities bool `json:"mergeEntities,omitempty"`
}
type ExtractResult ¶
type ExtractResult struct {
Results []ExtractItem `json:"results"`
Sources []any `json:"sources,omitempty"`
}
type ImagesResult ¶
type Job ¶
type Job struct {
ID string `json:"id"`
Kind string `json:"kind,omitempty"`
Status string `json:"status"`
SeedURL string `json:"seedUrl,omitempty"`
Total int `json:"total,omitempty"`
Completed int `json:"completed,omitempty"`
Failed int `json:"failed,omitempty"`
CreditsUsed int `json:"creditsUsed,omitempty"`
Pages []JobPage `json:"pages,omitempty"`
}
type JobPage ¶
type JobPage struct {
URL string `json:"url"`
RequestedURL string `json:"requestedUrl,omitempty"`
Status string `json:"status"`
Depth int `json:"depth,omitempty"`
Error string `json:"error,omitempty"`
ErrorCode string `json:"errorCode,omitempty"`
Retryable bool `json:"retryable,omitempty"`
Data *ScrapeResult `json:"data,omitempty"`
}
type LogoOptions ¶
type MapOptions ¶
type MapOptions struct {
IncludeLinks bool `json:"includeLinks,omitempty"`
Limit int `json:"limit,omitempty"`
Search string `json:"search,omitempty"`
Sitemap string `json:"sitemap,omitempty"`
SitemapInclude []string `json:"sitemapInclude,omitempty"`
SitemapExclude []string `json:"sitemapExclude,omitempty"`
IncludeSubdomains bool `json:"includeSubdomains,omitempty"`
IgnoreQueryParameters bool `json:"ignoreQueryParameters,omitempty"`
}
type Option ¶
type Option func(*Client)
func WithBaseURL ¶
func WithHTTPClient ¶
func WithMaxRetries ¶
func WithTimeout ¶
type ScrapeOptions ¶
type ScrapeOptions struct {
Formats []Format `json:"formats,omitempty"`
MaxAge int `json:"maxAge,omitempty"`
CacheOnly bool `json:"cacheOnly,omitempty"`
StoreInCache *bool `json:"storeInCache,omitempty"`
PreferStructure bool `json:"preferStructure,omitempty"`
OnlyMainContent bool `json:"onlyMainContent,omitempty"`
IncludeTags []string `json:"includeTags,omitempty"`
ExcludeTags []string `json:"excludeTags,omitempty"`
RemoveBase64Images bool `json:"removeBase64Images,omitempty"`
BlockAds bool `json:"blockAds,omitempty"`
IncludeLinks bool `json:"includeLinks,omitempty"`
WaitFor int `json:"waitFor,omitempty"`
Timeout int `json:"timeout,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
}
type ScrapeResult ¶
type ScrapeResult struct {
URL string `json:"url"`
FinalURL string `json:"finalUrl,omitempty"`
Redirected bool `json:"redirected,omitempty"`
Status int `json:"status,omitempty"`
Cached bool `json:"cached,omitempty"`
Warning string `json:"warning,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
Usage *Usage `json:"usage,omitempty"`
Markdown string `json:"markdown,omitempty"`
HTML string `json:"html,omitempty"`
RawHTML string `json:"rawHtml,omitempty"`
Links []string `json:"links,omitempty"`
Structured any `json:"structured,omitempty"`
Summary string `json:"summary,omitempty"`
JSON any `json:"json,omitempty"`
}
type ScreenshotOptions ¶
type ScreenshotResult ¶
type ScreenshotResult struct {
URL string `json:"url"`
FinalURL string `json:"finalUrl,omitempty"`
Status int `json:"status,omitempty"`
Screenshot string `json:"screenshot"`
ScreenshotType string `json:"screenshotType,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Cached bool `json:"cached,omitempty"`
}
type SearchItem ¶
type SearchItem struct {
Title string `json:"title"`
URL string `json:"url"`
Snippet string `json:"snippet"`
Rank int `json:"rank"`
Data *ScrapeResult `json:"data,omitempty"`
}
type SearchOptions ¶
type SearchOptions struct {
Limit int `json:"limit,omitempty"`
ScrapeResults bool `json:"scrapeResults,omitempty"`
ScrapeOptions *ScrapeOptions `json:"scrapeOptions,omitempty"`
TimeRange string `json:"timeRange,omitempty"`
Country string `json:"country,omitempty"`
IncludeDomains []string `json:"includeDomains,omitempty"`
ExcludeDomains []string `json:"excludeDomains,omitempty"`
}
type SearchResult ¶
type SearchResult struct {
Query string `json:"query"`
Status string `json:"status,omitempty"`
Results []SearchItem `json:"results"`
}
Click to show internal directories.
Click to hide internal directories.