serp

package
v0.0.0-...-a9d8f56 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptedSearchTypeParameters = []string{
	"web_search",
	"image_search",
	"google_shopping",
	"youtube_search",
}
View Source
var AcceptedTbmParameters = []string{
	"app",
	"bks",
	"blg",
	"dsc",
	"isch",
	"nws",
	"pts",
	"plcs",
	"rcp",
	"lcl",
}

Accepted Parameters for context options in google.

View Source
var BaiduSearchAcceptedDomainParameters = []oxylabs.Domain{
	oxylabs.DOMAIN_COM,
	oxylabs.DOMAIN_CN,
}

Accepted parameters for baidu.

Accepted parameters for bing.

Accepted parameters for yandex.

Functions

This section is empty.

Types

type BaiduSearchOpts

type BaiduSearchOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Limit             int
	UserAgent         oxylabs.UserAgent
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

BaiduSearchOpts contains all the query parameters available for baidu_search.

type BaiduUrlOpts

type BaiduUrlOpts struct {
	UserAgent         oxylabs.UserAgent
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

BaiduUrlOpts contains all the query parameters available for baidu.

type BingSearchOpts

type BingSearchOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Limit             int
	Locale            oxylabs.Locale
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	CallbackUrl       string
	Render            oxylabs.Render
	Parse             bool
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

BingSearchOpts contains all the query parameters available for bing_search.

type BingUrlOpts

type BingUrlOpts struct {
	UserAgent         oxylabs.UserAgent
	GeoLocation       string
	Render            oxylabs.Render
	CallbackUrl       string
	Parse             bool
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

BingUrlOpts contains all the query parameters available for bing.

type Category

type Category struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type Content

type Content struct {
	Url             string      `json:"url"`
	Page            int         `json:"page"`
	Errors          interface{} `json:"_errors"`
	Results         Result      `json:"results"`
	LastVisiblePage int         `json:"last_visible_page"`
	ParseStatusCode int         `json:"parse_status_code"`
}

type Expanded

type Expanded struct {
	Url   string `json:"url"`
	Desc  string `json:"desc"`
	Title string `json:"title"`
}

type Factoid

type Factoid struct {
	Links   []LinkElement `json:"links"`
	Title   string        `json:"title"`
	Content string        `json:"content"`
}

type FeaturedSnippet

type FeaturedSnippet struct {
	Url        string `json:"url"`
	Desc       string `json:"desc"`
	Title      string `json:"title"`
	UrlShown   string `json:"url_shown"`
	PosOverall int    `json:"pos_overall"`
}

type Flights

type Flights struct {
	To      string `json:"to"`
	From    string `json:"from"`
	DateTo  string `json:"date_to"`
	Results []struct {
		Url      string `json:"url"`
		Type     string `json:"type"`
		Price    string `json:"price"`
		Airline  string `json:"airline"`
		Duration string `json:"duration"`
	} `json:"results"`
	DateFrom   string `json:"date_from"`
	PosOverall int    `json:"pos_overall"`
}

type GoogleAdsOpts

type GoogleAdsOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Locale            string
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	Parse             bool
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	Context           []func(oxylabs.ContextOption)
}

GoogleAdsOpts contains all the query parameters available for google_ads.

type GoogleHotelsOpts

type GoogleHotelsOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Limit             int
	Locale            string
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	Context           []func(oxylabs.ContextOption)
}

GoogleHotelsOpts contains all the query parameters available for google_hotels.

type GoogleImagesOpts

type GoogleImagesOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Locale            string
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	Parse             bool
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	Context           []func(oxylabs.ContextOption)
}

GoogleImagesOpts contains all the query parameters available for google_images.

type GoogleSearchOpts

type GoogleSearchOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Limit             int
	Locale            oxylabs.Locale
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	Parse             bool
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	Context           []func(oxylabs.ContextOption)
}

GoogleSearchOpts contains all the query parameters available for google_search.

type GoogleSuggestionsOpts

type GoogleSuggestionsOpts struct {
	Locale            string
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	CallbackUrl       string
}

GoogleSuggestionsOpts contains all the query parameters available for google_shopping.

type GoogleTravelHotelsOpts

type GoogleTravelHotelsOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Locale            string
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
	Context           []func(oxylabs.ContextOption)
}

GoogleTravelHotelsOpts contains all the query parameters available for google_travel_hotels.

type GoogleTrendsExploreOpts

type GoogleTrendsExploreOpts struct {
	GeoLocation       string
	Context           []func(oxylabs.ContextOption)
	UserAgent         oxylabs.UserAgent
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

GoogleTrendsExploreOpts contains all the query parameters available for google_trends_explore.

type GoogleUrlOpts

type GoogleUrlOpts struct {
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	Parse             bool
	ParseInstructions *map[string]interface{}
	CallbackUrl       string
	PollInterval      time.Duration
}

GoogleUrlOpts contains all the query parameters available for google.

type Hotels

type Hotels struct {
	DateTo  string `json:"date_to"`
	Results []struct {
		Price       string `json:"price"`
		Title       string `json:"title"`
		Description string `json:"description"`
	} `json:"results"`
	DateFrom   string `json:"date_from"`
	PosOverall int    `json:"pos_overall"`
}

type Image

type Image struct {
	Items      []ImageItem `json:"items"`
	PosOverall int         `json:"pos_overall"`
}

type ImageItem

type ImageItem struct {
	Alt    string `json:"alt"`
	Pos    int    `json:"pos"`
	Url    string `json:"url"`
	Data   string `json:"data"`
	Source string `json:"source"`
}

type Inline

type Inline struct {
	Url   string `json:"url"`
	Desc  string `json:"desc"`
	Title string `json:"title"`
}

type InstantAnswers

type InstantAnswers struct {
	Type       string `json:"type"`
	Parsed     bool   `json:"_parsed"`
	PosOverall int    `json:"pos_overall"`
}

type ItemCarousel

type ItemCarousel struct {
	Items      []ItemCarouselItem `json:"items"`
	Title      string             `json:"title"`
	PosOverall int                `json:"pos_overall"`
}

type ItemCarouselItem

type ItemCarouselItem struct {
	Pos      int    `json:"pos"`
	Href     string `json:"href"`
	Title    string `json:"title"`
	Subtitle string `json:"subtitle"`
}

type Job

type Job struct {
	CallbackUrl string `json:"callback_url"`
	ClientID    int    `json:"client_id"`
	Context     []struct {
		Key   string      `json:"key"`
		Value interface{} `json:"value"`
	} `json:"context,omitempty"`
	CreatedAt           string        `json:"created_at"`
	Domain              string        `json:"domain"`
	GeoLocation         interface{}   `json:"geo_location"`
	ID                  string        `json:"id"`
	Limit               int           `json:"limit"`
	Locale              interface{}   `json:"locale"`
	Pages               int           `json:"pages"`
	Parse               bool          `json:"parse"`
	ParserType          interface{}   `json:"parser_type"`
	ParsingInstructions interface{}   `json:"parsing_instructions"`
	BrowserInstructions interface{}   `json:"browser_instructions"`
	Render              interface{}   `json:"render"`
	Url                 interface{}   `json:"url"`
	Query               string        `json:"query"`
	Source              string        `json:"source"`
	StartPage           int           `json:"start_page"`
	Status              string        `json:"status"`
	StorageType         interface{}   `json:"storage_type"`
	StorageUrl          interface{}   `json:"storage_url"`
	Subdomain           string        `json:"subdomain"`
	ContentEncoding     string        `json:"content_encoding"`
	UpdatedAt           string        `json:"updated_at"`
	UserAgentType       string        `json:"user_agent_type"`
	SessionInfo         interface{}   `json:"session_info"`
	Statuses            []interface{} `json:"statuses"`
	ClientNotes         interface{}   `json:"client_notes"`
	Links               []struct {
		Rel    string `json:"rel"`
		Href   string `json:"href"`
		Method string `json:"method"`
	} `json:"_links,omitempty"`
}

type Knowledge

type Knowledge struct {
	Title           string          `json:"title"`
	Images          []string        `json:"images"`
	Factoids        []Factoid       `json:"factoids"`
	Profiles        []Profile       `json:"profiles"`
	Subtitle        string          `json:"subtitle"`
	Description     string          `json:"description"`
	RelatedSearches []RelatedSearch `json:"related_searches"`
}

type LinkElement

type LinkElement struct {
	Href  string `json:"href"`
	Title string `json:"title"`
}

type LocalPack

type LocalPack struct {
	Items      []LocalPackItem `json:"items"`
	PosOverall int             `json:"pos_overall"`
}

type LocalPackItem

type LocalPackItem struct {
	Cid   string `json:"cid"`
	Pos   int    `json:"pos"`
	Links []struct {
		Href  string `json:"href"`
		Title string `json:"title"`
	} `json:"links"`
	Phone       string `json:"phone"`
	Title       string `json:"title"`
	Rating      int    `json:"rating"`
	Address     string `json:"address"`
	Subtitle    string `json:"subtitle"`
	RatingCount int    `json:"rating_count"`
}

type LocalServiceAds

type LocalServiceAds struct {
	Items []struct {
		Pos              int    `json:"pos"`
		Url              string `json:"url"`
		Title            string `json:"title"`
		Rating           int    `json:"rating"`
		ReviewsCount     int    `json:"reviews_count"`
		GoogleGuaranteed bool   `json:"google_guaranteed"`
	} `json:"items"`
	PosOverall int `json:"pos_overall"`
}
type Navigation struct {
	Pos   int    `json:"pos"`
	Url   string `json:"url"`
	Title string `json:"title"`
}

type Organic

type Organic struct {
	Pos        int              `json:"pos"`
	Url        string           `json:"url"`
	Desc       string           `json:"desc"`
	Title      string           `json:"title"`
	Images     []string         `json:"images"`
	Sitelinks  OrganicSitelinks `json:"sitelinks,omitempty"`
	UrlShown   string           `json:"url_shown"`
	PosOverall int              `json:"pos_overall"`
}
type OrganicSitelinks struct {
	Expanded []Expanded `json:"expanded,omitempty"`
	Inline   []Inline   `json:"inline,omitempty"`
}
type Paid struct {
	Pos        int           `json:"pos"`
	Url        string        `json:"url"`
	Desc       string        `json:"desc"`
	Title      string        `json:"title"`
	DataRw     string        `json:"data_rw"`
	DataPcu    []string      `json:"data_pcu"`
	Sitelinks  PaidSitelinks `json:"sitelinks"`
	UrlShown   string        `json:"url_shown"`
	PosOverall int           `json:"pos_overall"`
}
type PaidSitelinks struct {
	Expanded []Expanded `json:"expanded,omitempty"`
	Inline   []Inline   `json:"inline,omitempty"`
}

type Pla

type Pla struct {
	Items      []PlaItem `json:"items"`
	PosOverall int       `json:"pos_overall,omitempty"`
}

type PlaItem

type PlaItem struct {
	Pos       int    `json:"pos"`
	Url       string `json:"url"`
	Price     string `json:"price"`
	Title     string `json:"title"`
	Seller    string `json:"seller"`
	UrlImage  string `json:"url_image"`
	ImageData string `json:"image_data"`
}

type PopularProducts

type PopularProducts struct {
	Items      []PopularProductsItem `json:"items"`
	PosOverall int                   `json:"pos_overall"`
}

type PopularProductsItem

type PopularProductsItem struct {
	Pos       int    `json:"pos"`
	Price     string `json:"price"`
	Rating    string `json:"rating"`
	Seller    string `json:"seller"`
	Title     string `json:"title"`
	ImageData string `json:"image_data"`
}

type Profile

type Profile struct {
	Url   string `json:"url"`
	Title string `json:"title"`
}

type Recipes

type Recipes struct {
	Items      []RecipesItem `json:"items"`
	PosOverall int           `json:"pos_overall"`
}

type RecipesItem

type RecipesItem struct {
	Pos      int    `json:"pos"`
	Url      string `json:"url"`
	Desc     string `json:"desc"`
	Title    string `json:"title"`
	Rating   int    `json:"rating"`
	Source   string `json:"source"`
	Duration string `json:"duration"`
}

type RelatedQuestions

type RelatedQuestions struct {
	Items      []RelatedQuestionsItem `json:"items"`
	PosOverall int                    `json:"pos_overall"`
}

type RelatedQuestionsItem

type RelatedQuestionsItem struct {
	Pos      int    `json:"pos"`
	Answer   string `json:"answer"`
	Source   Source `json:"source"`
	Question string `json:"question"`
}

type RelatedSearch

type RelatedSearch struct {
	Url          string `json:"url"`
	Title        string `json:"title"`
	SectionTitle string `json:"section_title"`
}

type RelatedSearches

type RelatedSearches struct {
	PosOverall      int      `json:"pos_overall"`
	RelatedSearches []string `json:"related_searches"`
}

type RelatedSearchesCategorized

type RelatedSearchesCategorized struct {
	Items      []RelatedSearchesCategorizedItem `json:"items"`
	Category   Category                         `json:"category"`
	PosOverall int                              `json:"pos_overall"`
}

type RelatedSearchesCategorizedItem

type RelatedSearchesCategorizedItem struct {
	Url   string `json:"url"`
	Title string `json:"title"`
}

type Resp

type Resp struct {
	Parse             bool      `json:"parse"`
	ParseInstructions bool      `json:"parse_instructions"`
	Results           []Results `json:"results"`
	Job               Job       `json:"job"`
	StatusCode        int       `json:"status_code"`
	Status            string    `json:"status"`
}

Resp is the response struct for all serp sources.

func GetResp

func GetResp(
	httpResp *http.Response,
	parse bool,
	customParserFlag bool,
) (*Resp, error)

GetResp returns a Resp struct from the http.Response object. It will use the parse and customParserFlag parameters to determine how to parse the response.

func (*Resp) UnmarshalJSON

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

Custom function to unmarshal into the Resp struct. Because of different return types depending on the parse option.

type Result

type Result struct {
	Pla                        Pla                          `json:"pla"`
	Paid                       []Paid                       `json:"paid"`
	Images                     Image                        `json:"images"`
	Organic                    []Organic                    `json:"organic"`
	Twitter                    Twitter                      `json:"twitter"`
	Knowledge                  Knowledge                    `json:"knowledge"`
	LocalPack                  LocalPack                    `json:"local_pack"`
	TopStories                 TopStory                     `json:"top_stories"`
	PopularProducts            []PopularProducts            `json:"popular_products"`
	RelatedSearches            RelatedSearches              `json:"related_searches"`
	RelatedQuestions           RelatedQuestions             `json:"related_questions"`
	SearchInformation          SearchInformation            `json:"search_information"`
	ItemCarousel               ItemCarousel                 `json:"item_carousel"`
	Recipes                    Recipes                      `json:"recipes"`
	Videos                     Videos                       `json:"videos"`
	FeaturedSnippet            []FeaturedSnippet            `json:"featured_snippet"`
	RelatedSearchesCategorized []RelatedSearchesCategorized `json:"related_searches_categorized"`
	Hotels                     Hotels                       `json:"hotels"`
	Flights                    Flights                      `json:"flights"`
	VideoBox                   VideoBox                     `json:"video_box"`
	LocalServiceAds            LocalServiceAds              `json:"local_service_ads"`
	Navigation                 []Navigation                 `json:"navigation"`
	InstantAnswers             []InstantAnswers             `json:"instant_answers"`
	VisuallySimilarImages      VisuallySimilarImages        `json:"visually_similar_images"`

	TotalResultsCount int `json:"total_results_count"`
}

type Results

type Results struct {
	CustomContentParsed map[string]interface{}
	ContentParsed       Content
	Content             string
	CreatedAt           string `json:"created_at"`
	UpdatedAt           string `json:"updated_at"`
	Page                int    `json:"page"`
	Url                 string `json:"url"`
	JobID               string `json:"job_id"`
	StatusCode          int    `json:"status_code"`
	ParserType          string `json:"parser_type"`
}

type SearchInformation

type SearchInformation struct {
	Image struct {
		Url        string      `json:"url"`
		Width      int         `json:"width"`
		Height     int         `json:"height"`
		OtherSizes interface{} `json:"other_sizes"`
	} `json:"image"`
	Query             string `json:"query"`
	ShowingResultsFor string `json:"showing_results_for"`
	TotalResultsCount int    `json:"total_results_count"`
}

type SerpClient

type SerpClient struct {
	C *internal.Client
}

func Init

func Init(
	username string,
	password string,
) *SerpClient

Init for Sync runtime model.

func (*SerpClient) ScrapeBaiduSearch

func (c *SerpClient) ScrapeBaiduSearch(
	query string,
	opts ...*BaiduSearchOpts,
) (*Resp, error)

ScrapeBaiduSearch scrapes baidu via Oxylabs SERP API with baidu_search as source.

func (*SerpClient) ScrapeBaiduSearchCtx

func (c *SerpClient) ScrapeBaiduSearchCtx(
	ctx context.Context,
	query string,
	opts ...*BaiduSearchOpts,
) (*Resp, error)

ScrapeBaiduSearchCtx scrapes baidu via Oxylabs SERP API with baidu_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeBaiduUrl

func (c *SerpClient) ScrapeBaiduUrl(
	url string,
	opts ...*BaiduUrlOpts,
) (*Resp, error)

ScrapeBaiduUrl scrapes baidu via Oxylabs SERP API with baidu as source.

func (*SerpClient) ScrapeBaiduUrlCtx

func (c *SerpClient) ScrapeBaiduUrlCtx(
	ctx context.Context,
	url string,
	opts ...*BaiduUrlOpts,
) (*Resp, error)

ScrapeBaiduUrlCtx scrapes baidu via Oxylabs SERP API with baidu as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeBingSearch

func (c *SerpClient) ScrapeBingSearch(
	query string,
	opts ...*BingSearchOpts,
) (*Resp, error)

ScrapeBingSearch scrapes bing via Oxylabs SERP API with bing_search as source.

func (*SerpClient) ScrapeBingSearchCtx

func (c *SerpClient) ScrapeBingSearchCtx(
	ctx context.Context,
	query string,
	opts ...*BingSearchOpts,
) (*Resp, error)

ScrapeBingSearchCtx scrapes bing via Oxylabs SERP API with bing_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeBingUrl

func (c *SerpClient) ScrapeBingUrl(
	url string,
	opts ...*BingUrlOpts,
) (*Resp, error)

ScrapeBingUrl scrapes bing via Oxylabs SERP API with bing as source.

func (*SerpClient) ScrapeBingUrlCtx

func (c *SerpClient) ScrapeBingUrlCtx(
	ctx context.Context,
	url string,
	opts ...*BingUrlOpts,
) (*Resp, error)

ScrapeBingUrlCtx scrapes bing via Oxylabs SERP API with bing as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleAds

func (c *SerpClient) ScrapeGoogleAds(
	query string,
	opts ...*GoogleAdsOpts,
) (*Resp, error)

ScrapeGoogleAds scrapes google via Oxylabs SERP API with google_ads as source.

func (*SerpClient) ScrapeGoogleAdsCtx

func (c *SerpClient) ScrapeGoogleAdsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleAdsOpts,
) (*Resp, error)

ScrapeGoogleAdsCtx scrapes google via Oxylabs SERP API with google_ads as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleHotels

func (c *SerpClient) ScrapeGoogleHotels(
	query string,
	opts ...*GoogleHotelsOpts,
) (*Resp, error)

ScrapeGoogleHotels scrapes google via Oxylabs SERP API with google_hotels as source.

func (*SerpClient) ScrapeGoogleHotelsCtx

func (c *SerpClient) ScrapeGoogleHotelsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleHotelsOpts,
) (*Resp, error)

ScrapeGoogleHotelsCtx scrapes google via the google_hotels source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleImages

func (c *SerpClient) ScrapeGoogleImages(
	url string,
	opts ...*GoogleImagesOpts,
) (*Resp, error)

ScrapeGoogleImages scrapes google via Oxylabs SERP API with google_images as source.

func (*SerpClient) ScrapeGoogleImagesCtx

func (c *SerpClient) ScrapeGoogleImagesCtx(
	ctx context.Context,
	url string,
	opts ...*GoogleImagesOpts,
) (*Resp, error)

ScrapeGoogleImagesCtx scrapes google via Oxylabs SERP API with google_images as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleSearch

func (c *SerpClient) ScrapeGoogleSearch(
	query string,
	opts ...*GoogleSearchOpts,
) (*Resp, error)

ScrapeGoogleSearch scrapes google via Oxylabs SERP API with google_search as source.

func (*SerpClient) ScrapeGoogleSearchCtx

func (c *SerpClient) ScrapeGoogleSearchCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleSearchOpts,
) (*Resp, error)

ScrapeGoogleSearchCtx scrapes google via Oxylabs SERP API with google_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleSuggestions

func (c *SerpClient) ScrapeGoogleSuggestions(
	query string,
	opts ...*GoogleSuggestionsOpts,
) (*Resp, error)

ScrapeGoogleSuggestions scrapes google via Oxylabs SERP API with google_suggestions as source.

func (*SerpClient) ScrapeGoogleSuggestionsCtx

func (c *SerpClient) ScrapeGoogleSuggestionsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleSuggestionsOpts,
) (*Resp, error)

ScrapeGoogleSuggestionsCtx scrapes google via Oxylabs SERP API with google_suggestions as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleTravelHotels

func (c *SerpClient) ScrapeGoogleTravelHotels(
	query string,
	opts ...*GoogleTravelHotelsOpts,
) (*Resp, error)

ScrapeGoogleTravelHotels scrapes google via Oxylabs SERP API with google_travel_hotels as source.

func (*SerpClient) ScrapeGoogleTravelHotelsCtx

func (c *SerpClient) ScrapeGoogleTravelHotelsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleTravelHotelsOpts,
) (*Resp, error)

ScrapeGoogleTravelHotelsCtx scrapes google via Oxylabs SERP API with google_travel_hotels as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleTrendsExplore

func (c *SerpClient) ScrapeGoogleTrendsExplore(
	query string,
	opts ...*GoogleTrendsExploreOpts,
) (*Resp, error)

ScrapeGoogleTrendsExplore scrapes google via Oxylabs SERP API with google_trends_explore as source.

func (*SerpClient) ScrapeGoogleTrendsExploreCtx

func (c *SerpClient) ScrapeGoogleTrendsExploreCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleTrendsExploreOpts,
) (*Resp, error)

ScrapeGoogleTrendsExploreCtx scrapes google via Oxylabs SERP API with google_trends_explore as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeGoogleUrl

func (c *SerpClient) ScrapeGoogleUrl(
	url string,
	opts ...*GoogleUrlOpts,
) (*Resp, error)

ScrapeGoogleUrl scrapes google via Oxylabs SERP API with google as source.

func (*SerpClient) ScrapeGoogleUrlCtx

func (c *SerpClient) ScrapeGoogleUrlCtx(
	ctx context.Context,
	url string,
	opts ...*GoogleUrlOpts,
) (*Resp, error)

ScrapeGoogleUrlCtx scrapes google via Oxylabs SERP API with google as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeYandexSearch

func (c *SerpClient) ScrapeYandexSearch(
	query string,
	opts ...*YandexSearchOpts,
) (*Resp, error)

ScrapeYandexSearch scrapes yandex via Oxylabs SERP API with yandex_search as source.

func (*SerpClient) ScrapeYandexSearchCtx

func (c *SerpClient) ScrapeYandexSearchCtx(
	ctx context.Context,
	query string,
	opts ...*YandexSearchOpts,
) (*Resp, error)

ScrapeYandexSearchCtx scrapes yandex via Oxylabs SERP API with yandex_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClient) ScrapeYandexUrl

func (c *SerpClient) ScrapeYandexUrl(
	url string,
	opts ...*YandexUrlOpts,
) (*Resp, error)

ScrapeYandexUrl scrapes a yandex url via Oxylabs SERP API with yandex as source.

func (*SerpClient) ScrapeYandexUrlCtx

func (c *SerpClient) ScrapeYandexUrlCtx(
	ctx context.Context,
	url string,
	opts ...*YandexUrlOpts,
) (*Resp, error)

ScapeYandexUrlCtx scrapes a yandex url via Oxylabs SERP API with yandex as source. The provided context allows customization of the HTTP req, including setting timeouts.

type SerpClientAsync

type SerpClientAsync struct {
	C *internal.Client
}

func InitAsync

func InitAsync(
	username string,
	password string,
) *SerpClientAsync

Init for Async runtime model.

func (*SerpClientAsync) ScrapeBaiduSearch

func (c *SerpClientAsync) ScrapeBaiduSearch(
	query string,
	opts ...*BaiduSearchOpts,
) (chan *Resp, error)

ScrapeBaiduSearch scrapes baidu with async polling runtime via Oxylabs SERP API and baidu_search as source.

func (*SerpClientAsync) ScrapeBaiduSearchCtx

func (c *SerpClientAsync) ScrapeBaiduSearchCtx(
	ctx context.Context,
	query string,
	opts ...*BaiduSearchOpts,
) (chan *Resp, error)

ScrapeBaiduSearchCtx scrapes baidu with async polling runtime via Oxylabs SERP API and baidu_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeBaiduUrl

func (c *SerpClientAsync) ScrapeBaiduUrl(
	query string,
	opts ...*BaiduUrlOpts,
) (chan *Resp, error)

ScrapeBaiduUrl scrapes baidu with async polling runtime via Oxylabs SERP API and baidu as source.

func (*SerpClientAsync) ScrapeBaiduUrlCtx

func (c *SerpClientAsync) ScrapeBaiduUrlCtx(
	ctx context.Context,
	url string,
	opts ...*BaiduUrlOpts,
) (chan *Resp, error)

ScrapeBaiduUrlCtx scrapes baidu with async polling runtime via Oxylabs SERP API and baidu as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeBingSearch

func (c *SerpClientAsync) ScrapeBingSearch(
	query string,
	opts ...*BingSearchOpts,
) (chan *Resp, error)

ScrapeBingSearch scrapes bing with async polling runtime via Oxylabs SERP API and bing_search as source.

func (*SerpClientAsync) ScrapeBingSearchCtx

func (c *SerpClientAsync) ScrapeBingSearchCtx(
	ctx context.Context,
	query string,
	opts ...*BingSearchOpts,
) (chan *Resp, error)

ScrapeBingSearchCtx scrapes bing with async polling runtime via Oxylabs SERP API and bing_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeBingUrl

func (c *SerpClientAsync) ScrapeBingUrl(
	url string,
	opts ...*BingUrlOpts,
) (chan *Resp, error)

ScrapeBingUrl scrapes bing with async polling runtime via Oxylabs SERP API and bing as source.

func (*SerpClientAsync) ScrapeBingUrlCtx

func (c *SerpClientAsync) ScrapeBingUrlCtx(
	ctx context.Context,
	url string,
	opts ...*BingUrlOpts,
) (chan *Resp, error)

ScrapeBingUrlCtx scrapes bing with async polling runtime via Oxylabs SERP API and bing as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleAds

func (c *SerpClientAsync) ScrapeGoogleAds(
	query string,
	opts ...*GoogleAdsOpts,
) (chan *Resp, error)

ScrapeGoogleAds scrapes google with async polling runtime via Oxylabs SERP API and google_ads as source.

func (*SerpClientAsync) ScrapeGoogleAdsCtx

func (c *SerpClientAsync) ScrapeGoogleAdsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleAdsOpts,
) (chan *Resp, error)

ScrapeGoogleAdsCtx scrapes google with async polling runtime via Oxylabs SERP API and google_ads as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleHotels

func (c *SerpClientAsync) ScrapeGoogleHotels(
	query string,
	opts ...*GoogleHotelsOpts,
) (chan *Resp, error)

ScrapeGoogleHotels scrapes google with async polling runtime via Oxylabs SERP API and google_hotels as source.

func (*SerpClientAsync) ScrapeGoogleHotelsCtx

func (c *SerpClientAsync) ScrapeGoogleHotelsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleHotelsOpts,
) (chan *Resp, error)

ScrapeGoogleHotelsCtx scrapes google with async polling runtime via Oxylabs SERP API and google_hotels as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleImages

func (c *SerpClientAsync) ScrapeGoogleImages(
	url string,
	opts ...*GoogleImagesOpts,
) (chan *Resp, error)

ScrapeGoogleImages scrapes google with async polling runtime via Oxylabs SERP API and google_images as source.

func (*SerpClientAsync) ScrapeGoogleImagesCtx

func (c *SerpClientAsync) ScrapeGoogleImagesCtx(
	ctx context.Context,
	url string,
	opts ...*GoogleImagesOpts,
) (chan *Resp, error)

ScrapeGoogleImagesCtx scrapes google with async polling runtime via Oxylabs SERP API and google_images as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleSearch

func (c *SerpClientAsync) ScrapeGoogleSearch(
	query string,
	opts ...*GoogleSearchOpts,
) (chan *Resp, error)

ScrapeGoogleSearch scrapes google with async polling runtime via Oxylabs SERP API and google_search as source.

func (*SerpClientAsync) ScrapeGoogleSearchCtx

func (c *SerpClientAsync) ScrapeGoogleSearchCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleSearchOpts,
) (chan *Resp, error)

ScrapeGoogleSearchCtx scrapes google with async polling runtime via Oxylabs SERP API and google_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleSuggestions

func (c *SerpClientAsync) ScrapeGoogleSuggestions(
	query string,
	opts ...*GoogleSuggestionsOpts,
) (chan *Resp, error)

ScrapeGoogleSuggestions scrapes google with async polling runtime via Oxylabs SERP API and google_suggestions as source.

func (*SerpClientAsync) ScrapeGoogleSuggestionsCtx

func (c *SerpClientAsync) ScrapeGoogleSuggestionsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleSuggestionsOpts,
) (chan *Resp, error)

ScrapeGoogleSuggestionsCtx scrapes google with async polling runtime via Oxylabs SERP API and google_suggestions as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleTravelHotels

func (c *SerpClientAsync) ScrapeGoogleTravelHotels(
	query string,
	opts ...*GoogleTravelHotelsOpts,
) (chan *Resp, error)

ScrapeGoogleTravelHotels scrapes google with async polling runtime via Oxylabs SERP API and google_travel_hotels as source.

func (*SerpClientAsync) ScrapeGoogleTravelHotelsCtx

func (c *SerpClientAsync) ScrapeGoogleTravelHotelsCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleTravelHotelsOpts,
) (chan *Resp, error)

ScrapeGoogleTravelHotelsCtx scrapes google with async polling runtime via Oxylabs SERP API and google_travel_hotels as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleTrendsExplore

func (c *SerpClientAsync) ScrapeGoogleTrendsExplore(
	query string,
	opts ...*GoogleTrendsExploreOpts,
) (chan *Resp, error)

ScrapeGoogleTrendsExplore scrapes google with async polling runtime via Oxylabs SERP API and google_trends_explore as source.

func (*SerpClientAsync) ScrapeGoogleTrendsExploreCtx

func (c *SerpClientAsync) ScrapeGoogleTrendsExploreCtx(
	ctx context.Context,
	query string,
	opts ...*GoogleTrendsExploreOpts,
) (chan *Resp, error)

ScrapeGoogleTrendsExploreCtx scrapes google with async polling runtime via Oxylabs SERP API and google_trends_explore as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeGoogleUrl

func (c *SerpClientAsync) ScrapeGoogleUrl(
	url string,
	opts ...*GoogleUrlOpts,
) (chan *Resp, error)

ScrapeGoogleUrl scrapes google with async polling runtime via Oxylabs SERP API and google as source.

func (*SerpClientAsync) ScrapeGoogleUrlCtx

func (c *SerpClientAsync) ScrapeGoogleUrlCtx(
	ctx context.Context,
	url string,
	opts ...*GoogleUrlOpts,
) (chan *Resp, error)

ScrapeGoogleUrlCtx scrapes google with async polling runtime via Oxylabs SERP API and google as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeYandexSearch

func (c *SerpClientAsync) ScrapeYandexSearch(
	query string,
	opts ...*YandexSearchOpts,
) (chan *Resp, error)

ScrapeYandexSearch scrapes yandex with async polling runtime via Oxylabs SERP API and yandex_search as source.

func (*SerpClientAsync) ScrapeYandexSearchCtx

func (c *SerpClientAsync) ScrapeYandexSearchCtx(
	ctx context.Context,
	query string,
	opts ...*YandexSearchOpts,
) (chan *Resp, error)

ScrapeYandexSearchCtx scrapes yandex with async polling runtime via Oxylabs SERP API and yandex_search as source. The provided context allows customization of the HTTP req, including setting timeouts.

func (*SerpClientAsync) ScrapeYandexUrl

func (c *SerpClientAsync) ScrapeYandexUrl(
	url string,
	opts ...*YandexUrlOpts,
) (chan *Resp, error)

ScrapeYandexUrl scrapes yandex with async polling runtime via Oxylabs SERP API and yandex as source.

func (*SerpClientAsync) ScrapeYandexUrlCtx

func (c *SerpClientAsync) ScrapeYandexUrlCtx(
	ctx context.Context,
	url string,
	opts ...*YandexUrlOpts,
) (chan *Resp, error)

ScrapeYandexUrlCtx scrapes yandex with async polling runtime via Oxylabs SERP API and yandex as source. The provided context allows customization of the HTTP req, including setting timeouts.

type Source

type Source struct {
	Url      string `json:"url"`
	Title    string `json:"title"`
	UrlShown string `json:"url_shown"`
}

type TopStory

type TopStory struct {
	Items      []TopStoryItem `json:"items"`
	PosOverall int            `json:"pos_overall"`
}

type TopStoryItem

type TopStoryItem struct {
	Pos       int    `json:"pos"`
	Url       string `json:"url"`
	Title     string `json:"title"`
	Source    string `json:"source"`
	TimeFrame string `json:"time_frame"`
}

type Twitter

type Twitter struct {
	Pos        int           `json:"pos"`
	Url        string        `json:"url"`
	Items      []TwitterItem `json:"items"`
	Title      string        `json:"title"`
	PosOverall int           `json:"pos_overall"`
}

type TwitterItem

type TwitterItem struct {
	Pos       int    `json:"pos"`
	Url       string `json:"url"`
	Content   string `json:"content"`
	TimeFrame string `json:"time_frame"`
}

type VideoBox

type VideoBox struct {
	Url        string `json:"url"`
	Title      string `json:"title"`
	PosOverall int    `json:"pos_overall"`
}

type Videos

type Videos struct {
	Items      []VideosItem `json:"items"`
	PosOverall int          `json:"pos_overall"`
}

type VideosItem

type VideosItem struct {
	Pos    int    `json:"pos"`
	Url    string `json:"url"`
	Title  string `json:"title"`
	Author string `json:"author"`
	Source string `json:"source"`
}

type VisuallySimilarImages

type VisuallySimilarImages struct {
	AllImagesUrl   string   `json:"all_images_url"`
	FeaturedImages []string `json:"featured_images"`
}

type YandexSearchOpts

type YandexSearchOpts struct {
	Domain            oxylabs.Domain
	StartPage         int
	Pages             int
	Limit             int
	Locale            oxylabs.Locale
	GeoLocation       string
	UserAgent         oxylabs.UserAgent
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

YandexSearchOpts contains all the query parameters available for yandex_search.

type YandexUrlOpts

type YandexUrlOpts struct {
	UserAgent         oxylabs.UserAgent
	Render            oxylabs.Render
	CallbackUrl       string
	ParseInstructions *map[string]interface{}
	PollInterval      time.Duration
}

YandexUrlOpts contains all the query parameters available for yandex.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL