From 854c63c804ee07441e9af6df30ab1d1157f59cb8 Mon Sep 17 00:00:00 2001 From: julka Date: Wed, 26 Aug 2026 15:39:37 +0300 Subject: [PATCH] Regenerate typs using locally built IR json --- cmd/codegen/main.go | 6 + .../web_scraping_api/google_ai_mode/main.go | 29 - .../tiktok_shop_product/main.go | 29 - .../tiktok_shop_search/main.go | 29 - examples/web_scraping_api/tiktok_url/main.go | 29 - generated_parameters.go | 138 +- generated_params.go | 1954 ++++++----------- responses.go | 24 +- targets.go | 102 +- 9 files changed, 812 insertions(+), 1528 deletions(-) delete mode 100644 examples/web_scraping_api/google_ai_mode/main.go delete mode 100644 examples/web_scraping_api/tiktok_shop_product/main.go delete mode 100644 examples/web_scraping_api/tiktok_shop_search/main.go delete mode 100644 examples/web_scraping_api/tiktok_url/main.go diff --git a/cmd/codegen/main.go b/cmd/codegen/main.go index 0c61b88..6370553 100644 --- a/cmd/codegen/main.go +++ b/cmd/codegen/main.go @@ -171,6 +171,12 @@ func isOptional(t string) bool { func fetchIR() (*IR, error) { root := projectRoot() + // If DECODO_LOCAL_IR is set, skip GCS and use local file + if os.Getenv("DECODO_LOCAL_IR") != "" { + fmt.Println("DECODO_LOCAL_IR set, using local IR...") + return loadLocalIR(root) + } + // Fetch from GCS first (always get latest) fmt.Println("Fetching IR from GCS...") listURL := "https://storage.googleapis.com/storage/v1/b/decodo-sdk-config/o?prefix=decodo-ir-v" diff --git a/examples/web_scraping_api/google_ai_mode/main.go b/examples/web_scraping_api/google_ai_mode/main.go deleted file mode 100644 index 85cc5a0..0000000 --- a/examples/web_scraping_api/google_ai_mode/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/decodo/sdk-go" -) - -func main() { - client := decodo.NewClient(decodo.Config{ - WebScrapingAPI: &decodo.WebScrapingAPIConfig{Token: ""}, - }) - - params := decodo.NewGoogleAiModeParams() - params.Query = decodo.Ptr("What are the top three dog breeds?") - params.Parse = decodo.Ptr(true) - - res, err := client.WebScrapingAPI.Scrape(context.Background(), params) - if err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } - - out, _ := json.MarshalIndent(res, "", " ") - fmt.Println(string(out)) -} diff --git a/examples/web_scraping_api/tiktok_shop_product/main.go b/examples/web_scraping_api/tiktok_shop_product/main.go deleted file mode 100644 index e16619a..0000000 --- a/examples/web_scraping_api/tiktok_shop_product/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/decodo/sdk-go" -) - -func main() { - client := decodo.NewClient(decodo.Config{ - WebScrapingAPI: &decodo.WebScrapingAPIConfig{Token: ""}, - }) - - params := decodo.NewTiktokShopProductParams() - params.ProductID = decodo.Ptr("1731541214379741272") - params.Headless = decodo.Ptr("html") - - res, err := client.WebScrapingAPI.Scrape(context.Background(), params) - if err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } - - out, _ := json.MarshalIndent(res, "", " ") - fmt.Println(string(out)) -} diff --git a/examples/web_scraping_api/tiktok_shop_search/main.go b/examples/web_scraping_api/tiktok_shop_search/main.go deleted file mode 100644 index 34d3c28..0000000 --- a/examples/web_scraping_api/tiktok_shop_search/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/decodo/sdk-go" -) - -func main() { - client := decodo.NewClient(decodo.Config{ - WebScrapingAPI: &decodo.WebScrapingAPIConfig{Token: ""}, - }) - - params := decodo.NewTiktokShopSearchParams() - params.Query = decodo.Ptr("necklace") - params.Headless = decodo.Ptr("html") - - res, err := client.WebScrapingAPI.Scrape(context.Background(), params) - if err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } - - out, _ := json.MarshalIndent(res, "", " ") - fmt.Println(string(out)) -} diff --git a/examples/web_scraping_api/tiktok_url/main.go b/examples/web_scraping_api/tiktok_url/main.go deleted file mode 100644 index 03d581d..0000000 --- a/examples/web_scraping_api/tiktok_url/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/decodo/sdk-go" -) - -func main() { - client := decodo.NewClient(decodo.Config{ - WebScrapingAPI: &decodo.WebScrapingAPIConfig{Token: ""}, - }) - - params := decodo.NewTiktokParams() - params.URL = decodo.Ptr("https://www.tiktok.com/@nba/video/7255379108241198378") - params.Headless = decodo.Ptr("html") - - res, err := client.WebScrapingAPI.Scrape(context.Background(), params) - if err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } - - out, _ := json.MarshalIndent(res, "", " ") - fmt.Println(string(out)) -} diff --git a/generated_parameters.go b/generated_parameters.go index 3efaf5f..90b049b 100644 --- a/generated_parameters.go +++ b/generated_parameters.go @@ -19,80 +19,70 @@ type ItemsMeta struct { // ParameterMetaMap contains metadata for all known parameters. var ParameterMetaMap = map[string]ParameterMeta{ - "callback_url": {Type: "string"}, - "device_type": {Type: "string"}, - "geo": {Type: "string"}, - "headless": {Type: "string", Enum: []interface{}{"html", "png"}}, - "markdown": {Type: "boolean"}, - "url": {Type: "string", MaxLength: 2056}, - "xhr": {Type: "boolean"}, - "parse": {Type: "boolean"}, - "session_id": {Type: "string"}, - "category": {Type: "string"}, - "currency": {Type: "string"}, - "domain": {Type: "string"}, - "page_from": {Type: "number", Minimum: 0, Maximum: 100}, - "query": {Type: "string", MaxLength: 2048}, - "autoselect_variant": {Type: "boolean"}, - "merchant": {Type: "string"}, - "sort_by": {Type: "string"}, - "locale": {Type: "string"}, - "page_count": {Type: "number", Minimum: 1, Maximum: 10}, - "prompt": {Type: "string", MaxLength: 8192}, - "search": {Type: "boolean"}, - "parser_type": {Type: "string"}, - "google_nfpr": {Type: "boolean"}, + "callback_url": {Type: "string"}, + "device_type": {Type: "string"}, + "geo": {Type: "string"}, + "headless": {Type: "string", Enum: []interface{}{"html", "png"}}, + "markdown": {Type: "boolean"}, + "url": {Type: "string", MaxLength: 2056}, + "xhr": {Type: "boolean"}, + "parse": {Type: "boolean"}, + "session_id": {Type: "string"}, + "category": {Type: "string"}, + "currency": {Type: "string"}, + "domain": {Type: "string"}, + "page_from": {Type: "number", Minimum: 0, Maximum: 100}, + "query": {Type: "string", MaxLength: 2048}, + "autoselect_variant": {Type: "boolean"}, + "merchant": {Type: "string"}, + "sort_by": {Type: "string"}, + "locale": {Type: "string"}, + "page_count": {Type: "number", Minimum: 1, Maximum: 10}, + "prompt": {Type: "string", MaxLength: 8192}, + "search": {Type: "boolean"}, + "google_nfpr": {Type: "boolean"}, "google_results_language": {Type: "string"}, - "google_tbm": {Type: "string"}, - "google_tbs": {Type: "string"}, - "date_range": {Type: "string"}, - "hotel_occupancy": {Type: "string"}, - "google_safe_search": {Type: "boolean"}, - "adults": {Type: "number", Minimum: 1, Maximum: 3}, - "children": {Type: "number", Minimum: 1, Maximum: 3}, - "stars": {Type: "number"}, - "date_end": {Type: "string"}, - "date_start": {Type: "string"}, - "search_type": {Type: "string"}, - "delivery_today_tomorrow": {Type: "boolean"}, - "delivery_zip": {Type: "string"}, - "free_delivery": {Type: "boolean"}, - "lowes_store_id": {Type: "string"}, - "pickup_today": {Type: "boolean"}, - "user_agent_type": {Type: "string"}, - "sort": {Type: "string"}, - "target_store_id": {Type: "string"}, - "delivery_type": {Type: "string"}, - "product_id": {Type: "string"}, - "country": {Type: "string"}, - "cookies": {Type: "object"}, - "force_cookies": {Type: "boolean"}, - "force_headers": {Type: "boolean"}, - "headers": {Type: "object"}, - "http_method": {Type: "string"}, - "payload": {Type: "string"}, - "proxy_pool": {Type: "string", Enum: []interface{}{"standard", "premium"}}, + "google_tbm": {Type: "string"}, + "google_tbs": {Type: "string"}, + "google_safe_search": {Type: "boolean"}, + "adults": {Type: "number", Minimum: 1, Maximum: 3}, + "children": {Type: "number", Minimum: 1, Maximum: 3}, + "date_range": {Type: "string"}, + "stars": {Type: "number"}, + "sort": {Type: "string"}, + "delivery_zip": {Type: "string"}, + "target_store_id": {Type: "string"}, + "delivery_type": {Type: "string"}, + "product_id": {Type: "string"}, + "user_agent_type": {Type: "string"}, + "country": {Type: "string"}, + "cookies": {Type: "object"}, + "force_cookies": {Type: "boolean"}, + "force_headers": {Type: "boolean"}, + "headers": {Type: "object"}, + "http_method": {Type: "string"}, + "payload": {Type: "string"}, + "proxy_pool": {Type: "string", Enum: []interface{}{"standard", "premium"}}, "successful_status_codes": {Type: "array", Items: &ItemsMeta{Type: "number"}}, - "store_id": {Type: "string"}, - "fulfillment_type": {Type: "string"}, - "walmart_store_id": {Type: "string"}, - "limit": {Type: "number", Minimum: 0, Maximum: 100}, - "360": {Type: "boolean"}, - "3d": {Type: "boolean"}, - "4k": {Type: "boolean"}, - "creative_commons": {Type: "boolean"}, - "duration": {Type: "string"}, - "hd": {Type: "boolean"}, - "hdr": {Type: "boolean"}, - "live": {Type: "boolean"}, - "location": {Type: "boolean"}, - "purchased": {Type: "boolean"}, - "subtitles": {Type: "boolean"}, - "type": {Type: "string"}, - "upload_date": {Type: "string"}, - "video_sort_by": {Type: "string"}, - "vr180": {Type: "boolean"}, - "language_code": {Type: "string"}, - "subtitle_origin": {Type: "string"}, - "transcript_origin": {Type: "string"}, + "store_id": {Type: "string"}, + "fulfillment_type": {Type: "string"}, + "walmart_store_id": {Type: "string"}, + "limit": {Type: "number", Minimum: 0, Maximum: 100}, + "360": {Type: "boolean"}, + "3d": {Type: "boolean"}, + "4k": {Type: "boolean"}, + "creative_commons": {Type: "boolean"}, + "duration": {Type: "string"}, + "hd": {Type: "boolean"}, + "hdr": {Type: "boolean"}, + "live": {Type: "boolean"}, + "location": {Type: "boolean"}, + "purchased": {Type: "boolean"}, + "subtitles": {Type: "boolean"}, + "type": {Type: "string"}, + "upload_date": {Type: "string"}, + "video_sort_by": {Type: "string"}, + "vr180": {Type: "boolean"}, + "language_code": {Type: "string"}, + "subtitle_origin": {Type: "string"}, } diff --git a/generated_params.go b/generated_params.go index 56a65ec..c47e657 100644 --- a/generated_params.go +++ b/generated_params.go @@ -4,15 +4,15 @@ package decodo // AirbnbParams contains parameters for the airbnb target. type AirbnbParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -25,17 +25,17 @@ func NewAirbnbParams() *AirbnbParams { // AmazonParams contains parameters for the amazon target. type AmazonParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` SessionID *string `json:"session_id,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -48,19 +48,19 @@ func NewAmazonParams() *AmazonParams { // AmazonBestsellersParams contains parameters for the amazon_bestsellers target. type AmazonBestsellersParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Category *string `json:"category,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Category *string `json:"category,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -73,20 +73,20 @@ func NewAmazonBestsellersParams() *AmazonBestsellersParams { // AmazonPricingParams contains parameters for the amazon_pricing target. type AmazonPricingParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -99,20 +99,20 @@ func NewAmazonPricingParams() *AmazonPricingParams { // AmazonProductParams contains parameters for the amazon_product target. type AmazonProductParams struct { - Target Target `json:"target"` - AutoselectVariant *bool `json:"autoselect_variant,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + AutoselectVariant *bool `json:"autoselect_variant,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -125,23 +125,23 @@ func NewAmazonProductParams() *AmazonProductParams { // AmazonSearchParams contains parameters for the amazon_search target. type AmazonSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Category *string `json:"category,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Merchant *string `json:"merchant,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Category *string `json:"category,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Merchant *string `json:"merchant,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - SortBy *string `json:"sort_by,omitempty"` - XHR *bool `json:"xhr,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -154,18 +154,18 @@ func NewAmazonSearchParams() *AmazonSearchParams { // AmazonSellersParams contains parameters for the amazon_sellers target. type AmazonSellersParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -178,15 +178,15 @@ func NewAmazonSellersParams() *AmazonSellersParams { // AppleAppStoreParams contains parameters for the apple_app_store target. type AppleAppStoreParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -199,15 +199,15 @@ func NewAppleAppStoreParams() *AppleAppStoreParams { // AutotraderParams contains parameters for the autotrader target. type AutotraderParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -220,15 +220,15 @@ func NewAutotraderParams() *AutotraderParams { // BbbParams contains parameters for the bbb target. type BbbParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -241,19 +241,19 @@ func NewBbbParams() *BbbParams { // BingParams contains parameters for the bing target. type BingParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` SessionID *string `json:"session_id,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -266,21 +266,21 @@ func NewBingParams() *BingParams { // BingSearchParams contains parameters for the bing_search target. type BingSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -293,15 +293,15 @@ func NewBingSearchParams() *BingSearchParams { // ChatgptParams contains parameters for the chatgpt target. type ChatgptParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - Search *bool `json:"search,omitempty"` - XHR *bool `json:"xhr,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + Search *bool `json:"search,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -312,36 +312,14 @@ func NewChatgptParams() *ChatgptParams { return &ChatgptParams{Target: TargetChatgpt} } -// EcommerceParams contains parameters for the ecommerce target. -type EcommerceParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Parse *bool `json:"parse,omitempty"` - ParserType *string `json:"parser_type,omitempty"` - URL *string `json:"url,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *EcommerceParams) GetTarget() string { return string(p.Target) } - -// NewEcommerceParams creates a new EcommerceParams with the target pre-set. -func NewEcommerceParams() *EcommerceParams { - return &EcommerceParams{Target: TargetEcommerce} -} - // GeminiParams contains parameters for the gemini target. type GeminiParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Geo *string `json:"geo,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -354,18 +332,18 @@ func NewGeminiParams() *GeminiParams { // GoogleParams contains parameters for the google target. type GoogleParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - Parse *bool `json:"parse,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + Parse *bool `json:"parse,omitempty"` SessionID *string `json:"session_id,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -378,24 +356,24 @@ func NewGoogleParams() *GoogleParams { // GoogleAdsParams contains parameters for the google_ads target. type GoogleAdsParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + GoogleNfpr *bool `json:"google_nfpr,omitempty"` GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleTbm *string `json:"google_tbm,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + GoogleTbm *string `json:"google_tbm,omitempty"` + GoogleTbs *string `json:"google_tbs,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -408,15 +386,15 @@ func NewGoogleAdsParams() *GoogleAdsParams { // GoogleAiModeParams contains parameters for the google_ai_mode target. type GoogleAiModeParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -429,14 +407,14 @@ func NewGoogleAiModeParams() *GoogleAiModeParams { // GoogleLensParams contains parameters for the google_lens target. type GoogleLensParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -447,54 +425,27 @@ func NewGoogleLensParams() *GoogleLensParams { return &GoogleLensParams{Target: TargetGoogleLens} } -// GoogleMapsParams contains parameters for the google_maps target. -type GoogleMapsParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DateRange *string `json:"date_range,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - HotelOccupancy *string `json:"hotel_occupancy,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleMapsParams) GetTarget() string { return string(p.Target) } - -// NewGoogleMapsParams creates a new GoogleMapsParams with the target pre-set. -func NewGoogleMapsParams() *GoogleMapsParams { - return &GoogleMapsParams{Target: TargetGoogleMaps} -} - // GoogleSearchParams contains parameters for the google_search target. type GoogleSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + GoogleNfpr *bool `json:"google_nfpr,omitempty"` GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleSafeSearch *bool `json:"google_safe_search,omitempty"` - GoogleTbm *string `json:"google_tbm,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + GoogleSafeSearch *bool `json:"google_safe_search,omitempty"` + GoogleTbm *string `json:"google_tbm,omitempty"` + GoogleTbs *string `json:"google_tbs,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -505,93 +456,22 @@ func NewGoogleSearchParams() *GoogleSearchParams { return &GoogleSearchParams{Target: TargetGoogleSearch} } -// GoogleShoppingProductParams contains parameters for the google_shopping_product target. -type GoogleShoppingProductParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleShoppingProductParams) GetTarget() string { return string(p.Target) } - -// NewGoogleShoppingProductParams creates a new GoogleShoppingProductParams with the target pre-set. -func NewGoogleShoppingProductParams() *GoogleShoppingProductParams { - return &GoogleShoppingProductParams{Target: TargetGoogleShoppingProduct} -} - -// GoogleShoppingSearchParams contains parameters for the google_shopping_search target. -type GoogleShoppingSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleShoppingSearchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleShoppingSearchParams creates a new GoogleShoppingSearchParams with the target pre-set. -func NewGoogleShoppingSearchParams() *GoogleShoppingSearchParams { - return &GoogleShoppingSearchParams{Target: TargetGoogleShoppingSearch} -} - -// GoogleSuggestParams contains parameters for the google_suggest target. -type GoogleSuggestParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - Query *string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleSuggestParams) GetTarget() string { return string(p.Target) } - -// NewGoogleSuggestParams creates a new GoogleSuggestParams with the target pre-set. -func NewGoogleSuggestParams() *GoogleSuggestParams { - return &GoogleSuggestParams{Target: TargetGoogleSuggest} -} - // GoogleTravelHotelsParams contains parameters for the google_travel_hotels target. type GoogleTravelHotelsParams struct { - Target Target `json:"target"` - Adults *int `json:"adults,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - Children *int `json:"children,omitempty"` - DateRange *string `json:"date_range,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + Adults *int `json:"adults,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + Children *int `json:"children,omitempty"` + DateRange *string `json:"date_range,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Query *string `json:"query,omitempty"` SessionID *string `json:"session_id,omitempty"` - Stars *int `json:"stars,omitempty"` + Stars *int `json:"stars,omitempty"` } // GetTarget implements ScrapeRequest. @@ -602,75 +482,17 @@ func NewGoogleTravelHotelsParams() *GoogleTravelHotelsParams { return &GoogleTravelHotelsParams{Target: TargetGoogleTravelHotels} } -// GoogleTrendsExploreParams contains parameters for the google_trends_explore target. -type GoogleTrendsExploreParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DateEnd *string `json:"date_end,omitempty"` - DateStart *string `json:"date_start,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Query *string `json:"query,omitempty"` - SearchType *string `json:"search_type,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleTrendsExploreParams) GetTarget() string { return string(p.Target) } - -// NewGoogleTrendsExploreParams creates a new GoogleTrendsExploreParams with the target pre-set. -func NewGoogleTrendsExploreParams() *GoogleTrendsExploreParams { - return &GoogleTrendsExploreParams{Target: TargetGoogleTrendsExplore} -} - -// InstagramGraphqlProfileParams contains parameters for the instagram_graphql_profile target. -type InstagramGraphqlProfileParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Query *string `json:"query,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *InstagramGraphqlProfileParams) GetTarget() string { return string(p.Target) } - -// NewInstagramGraphqlProfileParams creates a new InstagramGraphqlProfileParams with the target pre-set. -func NewInstagramGraphqlProfileParams() *InstagramGraphqlProfileParams { - return &InstagramGraphqlProfileParams{Target: TargetInstagramGraphqlProfile} -} - -// LowesSearchParams contains parameters for the lowes_search target. -type LowesSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryTodayTomorrow *bool `json:"delivery_today_tomorrow,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - FreeDelivery *bool `json:"free_delivery,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - LowesStoreID *string `json:"lowes_store_id,omitempty"` - PickupToday *bool `json:"pickup_today,omitempty"` - Query *string `json:"query,omitempty"` - UserAgentType *string `json:"user_agent_type,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *LowesSearchParams) GetTarget() string { return string(p.Target) } - -// NewLowesSearchParams creates a new LowesSearchParams with the target pre-set. -func NewLowesSearchParams() *LowesSearchParams { - return &LowesSearchParams{Target: TargetLowesSearch} -} - // MobileParams contains parameters for the mobile target. type MobileParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -683,14 +505,14 @@ func NewMobileParams() *MobileParams { // PerplexityParams contains parameters for the perplexity target. type PerplexityParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - XHR *bool `json:"xhr,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -703,11 +525,11 @@ func NewPerplexityParams() *PerplexityParams { // RedditPostParams contains parameters for the reddit_post target. type RedditPostParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - URL *string `json:"url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + URL *string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -720,11 +542,11 @@ func NewRedditPostParams() *RedditPostParams { // RedditSubredditParams contains parameters for the reddit_subreddit target. type RedditSubredditParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - URL *string `json:"url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + URL *string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -737,12 +559,12 @@ func NewRedditSubredditParams() *RedditSubredditParams { // RedditUserParams contains parameters for the reddit_user target. type RedditUserParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - Sort *string `json:"sort,omitempty"` - URL *string `json:"url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + Sort *string `json:"sort,omitempty"` + URL *string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -755,15 +577,15 @@ func NewRedditUserParams() *RedditUserParams { // TargetParams contains parameters for the target target. type TargetParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` + Headless *string `json:"headless,omitempty"` TargetStoreID *string `json:"target_store_id,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -776,18 +598,18 @@ func NewTargetParams() *TargetParams { // TargetProductParams contains parameters for the target_product target. type TargetProductParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` DeliveryType *string `json:"delivery_type,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - ProductID *string `json:"product_id,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + ProductID *string `json:"product_id,omitempty"` TargetStoreID *string `json:"target_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -800,18 +622,18 @@ func NewTargetProductParams() *TargetProductParams { // TargetSearchParams contains parameters for the target_search target. type TargetSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` DeliveryType *string `json:"delivery_type,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` TargetStoreID *string `json:"target_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -824,11 +646,11 @@ func NewTargetSearchParams() *TargetSearchParams { // TiktokParams contains parameters for the tiktok target. type TiktokParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - URL *string `json:"url,omitempty"` + Headless *string `json:"headless,omitempty"` + URL *string `json:"url,omitempty"` UserAgentType *string `json:"user_agent_type,omitempty"` } @@ -842,10 +664,10 @@ func NewTiktokParams() *TiktokParams { // TiktokPostParams contains parameters for the tiktok_post target. type TiktokPostParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -858,15 +680,15 @@ func NewTiktokPostParams() *TiktokPostParams { // TiktokShopProductParams contains parameters for the tiktok_shop_product target. type TiktokShopProductParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Country *string `json:"country,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + Country *string `json:"country,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` ProductID *string `json:"product_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -879,14 +701,14 @@ func NewTiktokShopProductParams() *TiktokShopProductParams { // TiktokShopSearchParams contains parameters for the tiktok_shop_search target. type TiktokShopSearchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Country *string `json:"country,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + Country *string `json:"country,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Query *string `json:"query,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Query *string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -899,26 +721,26 @@ func NewTiktokShopSearchParams() *TiktokShopSearchParams { // UniversalParams contains parameters for the universal target. type UniversalParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Cookies map[string]interface{} `json:"cookies,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - ForceCookies *bool `json:"force_cookies,omitempty"` - ForceHeaders *bool `json:"force_headers,omitempty"` - Geo *string `json:"geo,omitempty"` - Headers map[string]interface{} `json:"headers,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Cookies map[string]interface{} `json:"cookies,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + ForceCookies *bool `json:"force_cookies,omitempty"` + ForceHeaders *bool `json:"force_headers,omitempty"` + Geo *string `json:"geo,omitempty"` + Headers map[string]interface{} `json:"headers,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` HTTPMethod *string `json:"http_method,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Payload *string `json:"payload,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Payload *string `json:"payload,omitempty"` // ProxyPool valid values: standard, premium - ProxyPool *string `json:"proxy_pool,omitempty"` - SessionID *string `json:"session_id,omitempty"` + ProxyPool *string `json:"proxy_pool,omitempty"` + SessionID *string `json:"session_id,omitempty"` SuccessfulStatusCodes []float64 `json:"successful_status_codes,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -929,33 +751,19 @@ func NewUniversalParams() *UniversalParams { return &UniversalParams{Target: TargetUniversal} } -// UniversalEcommerceParams contains parameters for the universal_ecommerce target. -type UniversalEcommerceParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *UniversalEcommerceParams) GetTarget() string { return string(p.Target) } - -// NewUniversalEcommerceParams creates a new UniversalEcommerceParams with the target pre-set. -func NewUniversalEcommerceParams() *UniversalEcommerceParams { - return &UniversalEcommerceParams{Target: TargetUniversalEcommerce} -} - // WalmartParams contains parameters for the walmart target. type WalmartParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - StoreID *string `json:"store_id,omitempty"` - URL *string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + StoreID *string `json:"store_id,omitempty"` + URL *string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -968,17 +776,17 @@ func NewWalmartParams() *WalmartParams { // WalmartProductParams contains parameters for the walmart_product target. type WalmartProductParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` FulfillmentType *string `json:"fulfillment_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - ProductID *string `json:"product_id,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + ProductID *string `json:"product_id,omitempty"` WalmartStoreID *string `json:"walmart_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -991,15 +799,15 @@ func NewWalmartProductParams() *WalmartProductParams { // WalmartSearchParams contains parameters for the walmart_search target. type WalmartSearchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` FulfillmentType *string `json:"fulfillment_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` WalmartStoreID *string `json:"walmart_store_id,omitempty"` } @@ -1013,12 +821,12 @@ func NewWalmartSearchParams() *WalmartSearchParams { // YoutubeChannelParams contains parameters for the youtube_channel target. type YoutubeChannelParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Limit *int `json:"limit,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query *string `json:"query,omitempty"` + Limit *int `json:"limit,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query *string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1031,9 +839,9 @@ func NewYoutubeChannelParams() *YoutubeChannelParams { // YoutubeMetadataParams contains parameters for the youtube_metadata target. type YoutubeMetadataParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Query *string `json:"query,omitempty"` + Query *string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1046,24 +854,24 @@ func NewYoutubeMetadataParams() *YoutubeMetadataParams { // YoutubeSearchParams contains parameters for the youtube_search target. type YoutubeSearchParams struct { - Target Target `json:"target"` - F360 *bool `json:"360,omitempty"` - F3d *bool `json:"3d,omitempty"` - F4k *bool `json:"4k,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - CreativeCommons *bool `json:"creative_commons,omitempty"` - Duration *string `json:"duration,omitempty"` - Hd *bool `json:"hd,omitempty"` - Hdr *bool `json:"hdr,omitempty"` - Live *bool `json:"live,omitempty"` - Location *bool `json:"location,omitempty"` - Purchased *bool `json:"purchased,omitempty"` - Query *string `json:"query,omitempty"` - Subtitles *bool `json:"subtitles,omitempty"` - Type *string `json:"type,omitempty"` - UploadDate *string `json:"upload_date,omitempty"` - VideoSortBy *string `json:"video_sort_by,omitempty"` - Vr180 *bool `json:"vr180,omitempty"` + Target Target `json:"target"` + F360 *bool `json:"360,omitempty"` + F3d *bool `json:"3d,omitempty"` + F4k *bool `json:"4k,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + CreativeCommons *bool `json:"creative_commons,omitempty"` + Duration *string `json:"duration,omitempty"` + Hd *bool `json:"hd,omitempty"` + Hdr *bool `json:"hdr,omitempty"` + Live *bool `json:"live,omitempty"` + Location *bool `json:"location,omitempty"` + Purchased *bool `json:"purchased,omitempty"` + Query *string `json:"query,omitempty"` + Subtitles *bool `json:"subtitles,omitempty"` + Type *string `json:"type,omitempty"` + UploadDate *string `json:"upload_date,omitempty"` + VideoSortBy *string `json:"video_sort_by,omitempty"` + Vr180 *bool `json:"vr180,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1074,43 +882,12 @@ func NewYoutubeSearchParams() *YoutubeSearchParams { return &YoutubeSearchParams{Target: TargetYoutubeSearch} } -// YoutubeSearchMaxParams contains parameters for the youtube_search_max target. -type YoutubeSearchMaxParams struct { - Target Target `json:"target"` - F360 *bool `json:"360,omitempty"` - F3d *bool `json:"3d,omitempty"` - F4k *bool `json:"4k,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - CreativeCommons *bool `json:"creative_commons,omitempty"` - Duration *string `json:"duration,omitempty"` - Hd *bool `json:"hd,omitempty"` - Hdr *bool `json:"hdr,omitempty"` - Live *bool `json:"live,omitempty"` - Location *bool `json:"location,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Purchased *bool `json:"purchased,omitempty"` - Query *string `json:"query,omitempty"` - Subtitles *bool `json:"subtitles,omitempty"` - Type *string `json:"type,omitempty"` - UploadDate *string `json:"upload_date,omitempty"` - VideoSortBy *string `json:"video_sort_by,omitempty"` - Vr180 *bool `json:"vr180,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeSearchMaxParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeSearchMaxParams creates a new YoutubeSearchMaxParams with the target pre-set. -func NewYoutubeSearchMaxParams() *YoutubeSearchMaxParams { - return &YoutubeSearchMaxParams{Target: TargetYoutubeSearchMax} -} - // YoutubeSubtitlesParams contains parameters for the youtube_subtitles target. type YoutubeSubtitlesParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - LanguageCode *string `json:"language_code,omitempty"` - Query *string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + LanguageCode *string `json:"language_code,omitempty"` + Query *string `json:"query,omitempty"` SubtitleOrigin *string `json:"subtitle_origin,omitempty"` } @@ -1122,50 +899,17 @@ func NewYoutubeSubtitlesParams() *YoutubeSubtitlesParams { return &YoutubeSubtitlesParams{Target: TargetYoutubeSubtitles} } -// YoutubeTranscriptParams contains parameters for the youtube_transcript target. -type YoutubeTranscriptParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - LanguageCode *string `json:"language_code,omitempty"` - Query *string `json:"query,omitempty"` - TranscriptOrigin *string `json:"transcript_origin,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeTranscriptParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeTranscriptParams creates a new YoutubeTranscriptParams with the target pre-set. -func NewYoutubeTranscriptParams() *YoutubeTranscriptParams { - return &YoutubeTranscriptParams{Target: TargetYoutubeTranscript} -} - -// YoutubeVideoParams contains parameters for the youtube_video target. -type YoutubeVideoParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Query *string `json:"query,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeVideoParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeVideoParams creates a new YoutubeVideoParams with the target pre-set. -func NewYoutubeVideoParams() *YoutubeVideoParams { - return &YoutubeVideoParams{Target: TargetYoutubeVideo} -} - // AirbnbBatchParams contains parameters for the airbnb target (batch mode). type AirbnbBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1178,17 +922,17 @@ func NewAirbnbBatchParams() *AirbnbBatchParams { // AmazonBatchParams contains parameters for the amazon target (batch mode). type AmazonBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - SessionID *string `json:"session_id,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + SessionID *string `json:"session_id,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1201,19 +945,19 @@ func NewAmazonBatchParams() *AmazonBatchParams { // AmazonBestsellersBatchParams contains parameters for the amazon_bestsellers target (batch mode). type AmazonBestsellersBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Category *string `json:"category,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Category *string `json:"category,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1226,20 +970,20 @@ func NewAmazonBestsellersBatchParams() *AmazonBestsellersBatchParams { // AmazonPricingBatchParams contains parameters for the amazon_pricing target (batch mode). type AmazonPricingBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1252,20 +996,20 @@ func NewAmazonPricingBatchParams() *AmazonPricingBatchParams { // AmazonProductBatchParams contains parameters for the amazon_product target (batch mode). type AmazonProductBatchParams struct { - Target Target `json:"target"` - AutoselectVariant *bool `json:"autoselect_variant,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + Target Target `json:"target"` + AutoselectVariant *bool `json:"autoselect_variant,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1278,23 +1022,23 @@ func NewAmazonProductBatchParams() *AmazonProductBatchParams { // AmazonSearchBatchParams contains parameters for the amazon_search target (batch mode). type AmazonSearchBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Category *string `json:"category,omitempty"` - Currency *string `json:"currency,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + Category *string `json:"category,omitempty"` + Currency *string `json:"currency,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Merchant *string `json:"merchant,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - SortBy *string `json:"sort_by,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Merchant *string `json:"merchant,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1307,18 +1051,18 @@ func NewAmazonSearchBatchParams() *AmazonSearchBatchParams { // AmazonSellersBatchParams contains parameters for the amazon_sellers target (batch mode). type AmazonSellersBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1331,15 +1075,15 @@ func NewAmazonSellersBatchParams() *AmazonSellersBatchParams { // AppleAppStoreBatchParams contains parameters for the apple_app_store target (batch mode). type AppleAppStoreBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1352,15 +1096,15 @@ func NewAppleAppStoreBatchParams() *AppleAppStoreBatchParams { // AutotraderBatchParams contains parameters for the autotrader target (batch mode). type AutotraderBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1373,15 +1117,15 @@ func NewAutotraderBatchParams() *AutotraderBatchParams { // BbbBatchParams contains parameters for the bbb target (batch mode). type BbbBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1394,19 +1138,19 @@ func NewBbbBatchParams() *BbbBatchParams { // BingBatchParams contains parameters for the bing target (batch mode). type BingBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - SessionID *string `json:"session_id,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + SessionID *string `json:"session_id,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1419,21 +1163,21 @@ func NewBingBatchParams() *BingBatchParams { // BingSearchBatchParams contains parameters for the bing_search target (batch mode). type BingSearchBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Domain *string `json:"domain,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Domain *string `json:"domain,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1446,15 +1190,15 @@ func NewBingSearchBatchParams() *BingSearchBatchParams { // ChatgptBatchParams contains parameters for the chatgpt target (batch mode). type ChatgptBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - Search *bool `json:"search,omitempty"` - XHR *bool `json:"xhr,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + Search *bool `json:"search,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1465,36 +1209,14 @@ func NewChatgptBatchParams() *ChatgptBatchParams { return &ChatgptBatchParams{Target: TargetChatgpt} } -// EcommerceBatchParams contains parameters for the ecommerce target (batch mode). -type EcommerceBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Parse *bool `json:"parse,omitempty"` - ParserType *string `json:"parser_type,omitempty"` - URL []string `json:"url,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *EcommerceBatchParams) GetTarget() string { return string(p.Target) } - -// NewEcommerceBatchParams creates a new EcommerceBatchParams with the target pre-set. -func NewEcommerceBatchParams() *EcommerceBatchParams { - return &EcommerceBatchParams{Target: TargetEcommerce} -} - // GeminiBatchParams contains parameters for the gemini target (batch mode). type GeminiBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Geo *string `json:"geo,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1507,18 +1229,18 @@ func NewGeminiBatchParams() *GeminiBatchParams { // GoogleBatchParams contains parameters for the google target (batch mode). type GoogleBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - Parse *bool `json:"parse,omitempty"` - SessionID *string `json:"session_id,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + Parse *bool `json:"parse,omitempty"` + SessionID *string `json:"session_id,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1531,24 +1253,24 @@ func NewGoogleBatchParams() *GoogleBatchParams { // GoogleAdsBatchParams contains parameters for the google_ads target (batch mode). type GoogleAdsBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + GoogleNfpr *bool `json:"google_nfpr,omitempty"` GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleTbm *string `json:"google_tbm,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` + GoogleTbm *string `json:"google_tbm,omitempty"` + GoogleTbs *string `json:"google_tbs,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1561,15 +1283,15 @@ func NewGoogleAdsBatchParams() *GoogleAdsBatchParams { // GoogleAiModeBatchParams contains parameters for the google_ai_mode target (batch mode). type GoogleAiModeBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1582,14 +1304,14 @@ func NewGoogleAiModeBatchParams() *GoogleAiModeBatchParams { // GoogleLensBatchParams contains parameters for the google_lens target (batch mode). type GoogleLensBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1600,54 +1322,27 @@ func NewGoogleLensBatchParams() *GoogleLensBatchParams { return &GoogleLensBatchParams{Target: TargetGoogleLens} } -// GoogleMapsBatchParams contains parameters for the google_maps target (batch mode). -type GoogleMapsBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DateRange *string `json:"date_range,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - HotelOccupancy *string `json:"hotel_occupancy,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleMapsBatchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleMapsBatchParams creates a new GoogleMapsBatchParams with the target pre-set. -func NewGoogleMapsBatchParams() *GoogleMapsBatchParams { - return &GoogleMapsBatchParams{Target: TargetGoogleMaps} -} - // GoogleSearchBatchParams contains parameters for the google_search target (batch mode). type GoogleSearchBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleNfpr *bool `json:"google_nfpr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + GoogleNfpr *bool `json:"google_nfpr,omitempty"` GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleSafeSearch *bool `json:"google_safe_search,omitempty"` - GoogleTbm *string `json:"google_tbm,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` + GoogleSafeSearch *bool `json:"google_safe_search,omitempty"` + GoogleTbm *string `json:"google_tbm,omitempty"` + GoogleTbs *string `json:"google_tbs,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageCount *int `json:"page_count,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageCount *int `json:"page_count,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1658,93 +1353,22 @@ func NewGoogleSearchBatchParams() *GoogleSearchBatchParams { return &GoogleSearchBatchParams{Target: TargetGoogleSearch} } -// GoogleShoppingProductBatchParams contains parameters for the google_shopping_product target (batch mode). -type GoogleShoppingProductBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleShoppingProductBatchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleShoppingProductBatchParams creates a new GoogleShoppingProductBatchParams with the target pre-set. -func NewGoogleShoppingProductBatchParams() *GoogleShoppingProductBatchParams { - return &GoogleShoppingProductBatchParams{Target: TargetGoogleShoppingProduct} -} - -// GoogleShoppingSearchBatchParams contains parameters for the google_shopping_search target (batch mode). -type GoogleShoppingSearchBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - GoogleResultsLanguage *string `json:"google_results_language,omitempty"` - GoogleTbs *string `json:"google_tbs,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleShoppingSearchBatchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleShoppingSearchBatchParams creates a new GoogleShoppingSearchBatchParams with the target pre-set. -func NewGoogleShoppingSearchBatchParams() *GoogleShoppingSearchBatchParams { - return &GoogleShoppingSearchBatchParams{Target: TargetGoogleShoppingSearch} -} - -// GoogleSuggestBatchParams contains parameters for the google_suggest target (batch mode). -type GoogleSuggestBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleSuggestBatchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleSuggestBatchParams creates a new GoogleSuggestBatchParams with the target pre-set. -func NewGoogleSuggestBatchParams() *GoogleSuggestBatchParams { - return &GoogleSuggestBatchParams{Target: TargetGoogleSuggest} -} - // GoogleTravelHotelsBatchParams contains parameters for the google_travel_hotels target (batch mode). type GoogleTravelHotelsBatchParams struct { - Target Target `json:"target"` - Adults *int `json:"adults,omitempty"` + Target Target `json:"target"` + Adults *int `json:"adults,omitempty"` CallbackURL *string `json:"callback_url,omitempty"` - Children *int `json:"children,omitempty"` - DateRange *string `json:"date_range,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + Children *int `json:"children,omitempty"` + DateRange *string `json:"date_range,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - PageFrom *int `json:"page_from,omitempty"` - Query []string `json:"query,omitempty"` - SessionID *string `json:"session_id,omitempty"` - Stars *int `json:"stars,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + PageFrom *int `json:"page_from,omitempty"` + Query []string `json:"query,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Stars *int `json:"stars,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1755,75 +1379,17 @@ func NewGoogleTravelHotelsBatchParams() *GoogleTravelHotelsBatchParams { return &GoogleTravelHotelsBatchParams{Target: TargetGoogleTravelHotels} } -// GoogleTrendsExploreBatchParams contains parameters for the google_trends_explore target (batch mode). -type GoogleTrendsExploreBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DateEnd *string `json:"date_end,omitempty"` - DateStart *string `json:"date_start,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Query []string `json:"query,omitempty"` - SearchType *string `json:"search_type,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *GoogleTrendsExploreBatchParams) GetTarget() string { return string(p.Target) } - -// NewGoogleTrendsExploreBatchParams creates a new GoogleTrendsExploreBatchParams with the target pre-set. -func NewGoogleTrendsExploreBatchParams() *GoogleTrendsExploreBatchParams { - return &GoogleTrendsExploreBatchParams{Target: TargetGoogleTrendsExplore} -} - -// InstagramGraphqlProfileBatchParams contains parameters for the instagram_graphql_profile target (batch mode). -type InstagramGraphqlProfileBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Query []string `json:"query,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *InstagramGraphqlProfileBatchParams) GetTarget() string { return string(p.Target) } - -// NewInstagramGraphqlProfileBatchParams creates a new InstagramGraphqlProfileBatchParams with the target pre-set. -func NewInstagramGraphqlProfileBatchParams() *InstagramGraphqlProfileBatchParams { - return &InstagramGraphqlProfileBatchParams{Target: TargetInstagramGraphqlProfile} -} - -// LowesSearchBatchParams contains parameters for the lowes_search target (batch mode). -type LowesSearchBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryTodayTomorrow *bool `json:"delivery_today_tomorrow,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - FreeDelivery *bool `json:"free_delivery,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - LowesStoreID *string `json:"lowes_store_id,omitempty"` - PickupToday *bool `json:"pickup_today,omitempty"` - Query []string `json:"query,omitempty"` - UserAgentType *string `json:"user_agent_type,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *LowesSearchBatchParams) GetTarget() string { return string(p.Target) } - -// NewLowesSearchBatchParams creates a new LowesSearchBatchParams with the target pre-set. -func NewLowesSearchBatchParams() *LowesSearchBatchParams { - return &LowesSearchBatchParams{Target: TargetLowesSearch} -} - // MobileBatchParams contains parameters for the mobile target (batch mode). type MobileBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1836,14 +1402,14 @@ func NewMobileBatchParams() *MobileBatchParams { // PerplexityBatchParams contains parameters for the perplexity target (batch mode). type PerplexityBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Prompt *string `json:"prompt,omitempty"` - XHR *bool `json:"xhr,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Prompt *string `json:"prompt,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1856,11 +1422,11 @@ func NewPerplexityBatchParams() *PerplexityBatchParams { // RedditPostBatchParams contains parameters for the reddit_post target (batch mode). type RedditPostBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - URL []string `json:"url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + URL []string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1873,11 +1439,11 @@ func NewRedditPostBatchParams() *RedditPostBatchParams { // RedditSubredditBatchParams contains parameters for the reddit_subreddit target (batch mode). type RedditSubredditBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - URL []string `json:"url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + URL []string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1890,12 +1456,12 @@ func NewRedditSubredditBatchParams() *RedditSubredditBatchParams { // RedditUserBatchParams contains parameters for the reddit_user target (batch mode). type RedditUserBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Locale *string `json:"locale,omitempty"` - Sort *string `json:"sort,omitempty"` - URL []string `json:"url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Geo *string `json:"geo,omitempty"` + Locale *string `json:"locale,omitempty"` + Sort *string `json:"sort,omitempty"` + URL []string `json:"url,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1908,15 +1474,15 @@ func NewRedditUserBatchParams() *RedditUserBatchParams { // TargetBatchParams contains parameters for the target target (batch mode). type TargetBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - TargetStoreID *string `json:"target_store_id,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + TargetStoreID *string `json:"target_store_id,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1929,18 +1495,18 @@ func NewTargetBatchParams() *TargetBatchParams { // TargetProductBatchParams contains parameters for the target_product target (batch mode). type TargetProductBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` DeliveryType *string `json:"delivery_type,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - ProductID *string `json:"product_id,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + ProductID *string `json:"product_id,omitempty"` TargetStoreID *string `json:"target_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1953,18 +1519,18 @@ func NewTargetProductBatchParams() *TargetProductBatchParams { // TargetSearchBatchParams contains parameters for the target_search target (batch mode). type TargetSearchBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` DeliveryType *string `json:"delivery_type,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - TargetStoreID *string `json:"target_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + TargetStoreID *string `json:"target_store_id,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1977,12 +1543,12 @@ func NewTargetSearchBatchParams() *TargetSearchBatchParams { // TiktokBatchParams contains parameters for the tiktok target (batch mode). type TiktokBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - URL []string `json:"url,omitempty"` - UserAgentType *string `json:"user_agent_type,omitempty"` + Headless *string `json:"headless,omitempty"` + URL []string `json:"url,omitempty"` + UserAgentType *string `json:"user_agent_type,omitempty"` } // GetTarget implements ScrapeRequest. @@ -1995,10 +1561,10 @@ func NewTiktokBatchParams() *TiktokBatchParams { // TiktokPostBatchParams contains parameters for the tiktok_post target (batch mode). type TiktokPostBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2011,15 +1577,15 @@ func NewTiktokPostBatchParams() *TiktokPostBatchParams { // TiktokShopProductBatchParams contains parameters for the tiktok_shop_product target (batch mode). type TiktokShopProductBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Country *string `json:"country,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + Country *string `json:"country,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` ProductID *string `json:"product_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2032,14 +1598,14 @@ func NewTiktokShopProductBatchParams() *TiktokShopProductBatchParams { // TiktokShopSearchBatchParams contains parameters for the tiktok_shop_search target (batch mode). type TiktokShopSearchBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - Country *string `json:"country,omitempty"` - DeviceType *string `json:"device_type,omitempty"` + Country *string `json:"country,omitempty"` + DeviceType *string `json:"device_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Query []string `json:"query,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Query []string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2052,26 +1618,26 @@ func NewTiktokShopSearchBatchParams() *TiktokShopSearchBatchParams { // UniversalBatchParams contains parameters for the universal target (batch mode). type UniversalBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Cookies map[string]interface{} `json:"cookies,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - ForceCookies *bool `json:"force_cookies,omitempty"` - ForceHeaders *bool `json:"force_headers,omitempty"` - Geo *string `json:"geo,omitempty"` - Headers map[string]interface{} `json:"headers,omitempty"` - // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Cookies map[string]interface{} `json:"cookies,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + ForceCookies *bool `json:"force_cookies,omitempty"` + ForceHeaders *bool `json:"force_headers,omitempty"` + Geo *string `json:"geo,omitempty"` + Headers map[string]interface{} `json:"headers,omitempty"` + // Headless valid values: html, png + Headless *string `json:"headless,omitempty"` HTTPMethod *string `json:"http_method,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Payload *string `json:"payload,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Payload *string `json:"payload,omitempty"` // ProxyPool valid values: standard, premium - ProxyPool *string `json:"proxy_pool,omitempty"` - SessionID *string `json:"session_id,omitempty"` + ProxyPool *string `json:"proxy_pool,omitempty"` + SessionID *string `json:"session_id,omitempty"` SuccessfulStatusCodes []float64 `json:"successful_status_codes,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2082,33 +1648,19 @@ func NewUniversalBatchParams() *UniversalBatchParams { return &UniversalBatchParams{Target: TargetUniversal} } -// UniversalEcommerceBatchParams contains parameters for the universal_ecommerce target (batch mode). -type UniversalEcommerceBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *UniversalEcommerceBatchParams) GetTarget() string { return string(p.Target) } - -// NewUniversalEcommerceBatchParams creates a new UniversalEcommerceBatchParams with the target pre-set. -func NewUniversalEcommerceBatchParams() *UniversalEcommerceBatchParams { - return &UniversalEcommerceBatchParams{Target: TargetUniversalEcommerce} -} - // WalmartBatchParams contains parameters for the walmart target (batch mode). type WalmartBatchParams struct { - Target Target `json:"target"` + Target Target `json:"target"` CallbackURL *string `json:"callback_url,omitempty"` - DeviceType *string `json:"device_type,omitempty"` - Geo *string `json:"geo,omitempty"` + DeviceType *string `json:"device_type,omitempty"` + Geo *string `json:"geo,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Locale *string `json:"locale,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - StoreID *string `json:"store_id,omitempty"` - URL []string `json:"url,omitempty"` - XHR *bool `json:"xhr,omitempty"` + Headless *string `json:"headless,omitempty"` + Locale *string `json:"locale,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + StoreID *string `json:"store_id,omitempty"` + URL []string `json:"url,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2121,17 +1673,17 @@ func NewWalmartBatchParams() *WalmartBatchParams { // WalmartProductBatchParams contains parameters for the walmart_product target (batch mode). type WalmartProductBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` FulfillmentType *string `json:"fulfillment_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - ProductID *string `json:"product_id,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + ProductID *string `json:"product_id,omitempty"` WalmartStoreID *string `json:"walmart_store_id,omitempty"` - XHR *bool `json:"xhr,omitempty"` + XHR *bool `json:"xhr,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2144,16 +1696,16 @@ func NewWalmartProductBatchParams() *WalmartProductBatchParams { // WalmartSearchBatchParams contains parameters for the walmart_search target (batch mode). type WalmartSearchBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - DeliveryZip *string `json:"delivery_zip,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + DeliveryZip *string `json:"delivery_zip,omitempty"` FulfillmentType *string `json:"fulfillment_type,omitempty"` // Headless valid values: html, png - Headless *string `json:"headless,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` - WalmartStoreID *string `json:"walmart_store_id,omitempty"` + Headless *string `json:"headless,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` + WalmartStoreID *string `json:"walmart_store_id,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2166,12 +1718,12 @@ func NewWalmartSearchBatchParams() *WalmartSearchBatchParams { // YoutubeChannelBatchParams contains parameters for the youtube_channel target (batch mode). type YoutubeChannelBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Limit *int `json:"limit,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Parse *bool `json:"parse,omitempty"` - Query []string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Limit *int `json:"limit,omitempty"` + Markdown *bool `json:"markdown,omitempty"` + Parse *bool `json:"parse,omitempty"` + Query []string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2184,9 +1736,9 @@ func NewYoutubeChannelBatchParams() *YoutubeChannelBatchParams { // YoutubeMetadataBatchParams contains parameters for the youtube_metadata target (batch mode). type YoutubeMetadataBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Query []string `json:"query,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + Query []string `json:"query,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2199,24 +1751,24 @@ func NewYoutubeMetadataBatchParams() *YoutubeMetadataBatchParams { // YoutubeSearchBatchParams contains parameters for the youtube_search target (batch mode). type YoutubeSearchBatchParams struct { - Target Target `json:"target"` - F360 *bool `json:"360,omitempty"` - F3d *bool `json:"3d,omitempty"` - F4k *bool `json:"4k,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - CreativeCommons *bool `json:"creative_commons,omitempty"` - Duration *string `json:"duration,omitempty"` - Hd *bool `json:"hd,omitempty"` - Hdr *bool `json:"hdr,omitempty"` - Live *bool `json:"live,omitempty"` - Location *bool `json:"location,omitempty"` - Purchased *bool `json:"purchased,omitempty"` - Query []string `json:"query,omitempty"` - Subtitles *bool `json:"subtitles,omitempty"` - Type *string `json:"type,omitempty"` - UploadDate *string `json:"upload_date,omitempty"` - VideoSortBy *string `json:"video_sort_by,omitempty"` - Vr180 *bool `json:"vr180,omitempty"` + Target Target `json:"target"` + F360 *bool `json:"360,omitempty"` + F3d *bool `json:"3d,omitempty"` + F4k *bool `json:"4k,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + CreativeCommons *bool `json:"creative_commons,omitempty"` + Duration *string `json:"duration,omitempty"` + Hd *bool `json:"hd,omitempty"` + Hdr *bool `json:"hdr,omitempty"` + Live *bool `json:"live,omitempty"` + Location *bool `json:"location,omitempty"` + Purchased *bool `json:"purchased,omitempty"` + Query []string `json:"query,omitempty"` + Subtitles *bool `json:"subtitles,omitempty"` + Type *string `json:"type,omitempty"` + UploadDate *string `json:"upload_date,omitempty"` + VideoSortBy *string `json:"video_sort_by,omitempty"` + Vr180 *bool `json:"vr180,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2227,44 +1779,13 @@ func NewYoutubeSearchBatchParams() *YoutubeSearchBatchParams { return &YoutubeSearchBatchParams{Target: TargetYoutubeSearch} } -// YoutubeSearchMaxBatchParams contains parameters for the youtube_search_max target (batch mode). -type YoutubeSearchMaxBatchParams struct { - Target Target `json:"target"` - F360 *bool `json:"360,omitempty"` - F3d *bool `json:"3d,omitempty"` - F4k *bool `json:"4k,omitempty"` - CallbackURL *string `json:"callback_url,omitempty"` - CreativeCommons *bool `json:"creative_commons,omitempty"` - Duration *string `json:"duration,omitempty"` - Hd *bool `json:"hd,omitempty"` - Hdr *bool `json:"hdr,omitempty"` - Live *bool `json:"live,omitempty"` - Location *bool `json:"location,omitempty"` - Markdown *bool `json:"markdown,omitempty"` - Purchased *bool `json:"purchased,omitempty"` - Query []string `json:"query,omitempty"` - Subtitles *bool `json:"subtitles,omitempty"` - Type *string `json:"type,omitempty"` - UploadDate *string `json:"upload_date,omitempty"` - VideoSortBy *string `json:"video_sort_by,omitempty"` - Vr180 *bool `json:"vr180,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeSearchMaxBatchParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeSearchMaxBatchParams creates a new YoutubeSearchMaxBatchParams with the target pre-set. -func NewYoutubeSearchMaxBatchParams() *YoutubeSearchMaxBatchParams { - return &YoutubeSearchMaxBatchParams{Target: TargetYoutubeSearchMax} -} - // YoutubeSubtitlesBatchParams contains parameters for the youtube_subtitles target (batch mode). type YoutubeSubtitlesBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - LanguageCode *string `json:"language_code,omitempty"` - Query []string `json:"query,omitempty"` - SubtitleOrigin *string `json:"subtitle_origin,omitempty"` + Target Target `json:"target"` + CallbackURL *string `json:"callback_url,omitempty"` + LanguageCode *string `json:"language_code,omitempty"` + Query []string `json:"query,omitempty"` + SubtitleOrigin *string `json:"subtitle_origin,omitempty"` } // GetTarget implements ScrapeRequest. @@ -2275,39 +1796,6 @@ func NewYoutubeSubtitlesBatchParams() *YoutubeSubtitlesBatchParams { return &YoutubeSubtitlesBatchParams{Target: TargetYoutubeSubtitles} } -// YoutubeTranscriptBatchParams contains parameters for the youtube_transcript target (batch mode). -type YoutubeTranscriptBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - LanguageCode *string `json:"language_code,omitempty"` - Query []string `json:"query,omitempty"` - TranscriptOrigin *string `json:"transcript_origin,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeTranscriptBatchParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeTranscriptBatchParams creates a new YoutubeTranscriptBatchParams with the target pre-set. -func NewYoutubeTranscriptBatchParams() *YoutubeTranscriptBatchParams { - return &YoutubeTranscriptBatchParams{Target: TargetYoutubeTranscript} -} - -// YoutubeVideoBatchParams contains parameters for the youtube_video target (batch mode). -type YoutubeVideoBatchParams struct { - Target Target `json:"target"` - CallbackURL *string `json:"callback_url,omitempty"` - Geo *string `json:"geo,omitempty"` - Query []string `json:"query,omitempty"` -} - -// GetTarget implements ScrapeRequest. -func (p *YoutubeVideoBatchParams) GetTarget() string { return string(p.Target) } - -// NewYoutubeVideoBatchParams creates a new YoutubeVideoBatchParams with the target pre-set. -func NewYoutubeVideoBatchParams() *YoutubeVideoBatchParams { - return &YoutubeVideoBatchParams{Target: TargetYoutubeVideo} -} - // TargetMetaMap contains metadata for all targets. var TargetMetaMap = map[Target]*TargetInfo{ TargetAirbnb: { @@ -2375,11 +1863,6 @@ var TargetMetaMap = map[Target]*TargetInfo{ ResponseFormat: "json", Parameters: []string{"callback_url", "device_type", "geo", "markdown", "parse", "prompt", "search", "xhr"}, }, - TargetEcommerce: { - Group: "Other eCommerce", - ResponseFormat: "json", - Parameters: []string{"callback_url", "device_type", "geo", "headless", "locale", "parse", "parser_type", "url"}, - }, TargetGemini: { Group: "AI Tools", ResponseFormat: "json", @@ -2405,51 +1888,16 @@ var TargetMetaMap = map[Target]*TargetInfo{ ResponseFormat: "json", Parameters: []string{"callback_url", "device_type", "headless", "markdown", "parse", "query"}, }, - TargetGoogleMaps: { - Group: "Google", - ResponseFormat: "html", - Parameters: []string{"callback_url", "date_range", "device_type", "geo", "google_nfpr", "google_results_language", "headless", "hotel_occupancy", "locale", "markdown", "page_from", "query", "session_id"}, - }, TargetGoogleSearch: { Group: "Google", ResponseFormat: "json", Parameters: []string{"callback_url", "device_type", "geo", "google_nfpr", "google_results_language", "google_safe_search", "google_tbm", "google_tbs", "headless", "locale", "markdown", "page_count", "page_from", "parse", "query", "session_id", "xhr"}, }, - TargetGoogleShoppingProduct: { - Group: "Google", - ResponseFormat: "json", - Parameters: []string{"callback_url", "device_type", "geo", "google_results_language", "headless", "locale", "markdown", "page_from", "parse", "query", "session_id", "xhr"}, - }, - TargetGoogleShoppingSearch: { - Group: "Google", - ResponseFormat: "json", - Parameters: []string{"callback_url", "device_type", "geo", "google_results_language", "google_tbs", "headless", "locale", "markdown", "page_from", "parse", "query", "session_id"}, - }, - TargetGoogleSuggest: { - Group: "Google", - ResponseFormat: "json", - Parameters: []string{"callback_url", "device_type", "geo", "locale", "query", "session_id"}, - }, TargetGoogleTravelHotels: { Group: "Google", ResponseFormat: "html", Parameters: []string{"adults", "callback_url", "children", "date_range", "device_type", "headless", "locale", "markdown", "page_from", "query", "session_id", "stars"}, }, - TargetGoogleTrendsExplore: { - Group: "Google", - ResponseFormat: "json", - Parameters: []string{"callback_url", "date_end", "date_start", "device_type", "geo", "query", "search_type"}, - }, - TargetInstagramGraphqlProfile: { - Group: "Instagram", - ResponseFormat: "json", - Parameters: []string{"callback_url", "query"}, - }, - TargetLowesSearch: { - Group: "Lowe's", - ResponseFormat: "json", - Parameters: []string{"callback_url", "delivery_today_tomorrow", "delivery_zip", "free_delivery", "headless", "lowes_store_id", "pickup_today", "query", "user_agent_type"}, - }, TargetMobile: { Group: "Marketplace", ResponseFormat: "html", @@ -2515,11 +1963,6 @@ var TargetMetaMap = map[Target]*TargetInfo{ ResponseFormat: "html", Parameters: []string{"callback_url", "cookies", "device_type", "force_cookies", "force_headers", "geo", "headers", "headless", "http_method", "locale", "markdown", "payload", "proxy_pool", "session_id", "successful_status_codes", "url", "xhr"}, }, - TargetUniversalEcommerce: { - Group: "None", - ResponseFormat: "html", - Parameters: []string{"callback_url"}, - }, TargetWalmart: { Group: "Walmart", ResponseFormat: "html", @@ -2550,24 +1993,9 @@ var TargetMetaMap = map[Target]*TargetInfo{ ResponseFormat: "json", Parameters: []string{"360", "3d", "4k", "callback_url", "creative_commons", "duration", "hd", "hdr", "live", "location", "purchased", "query", "subtitles", "type", "upload_date", "video_sort_by", "vr180"}, }, - TargetYoutubeSearchMax: { - Group: "YouTube", - ResponseFormat: "json", - Parameters: []string{"360", "3d", "4k", "callback_url", "creative_commons", "duration", "hd", "hdr", "live", "location", "markdown", "purchased", "query", "subtitles", "type", "upload_date", "video_sort_by", "vr180"}, - }, TargetYoutubeSubtitles: { Group: "YouTube", ResponseFormat: "json", Parameters: []string{"callback_url", "language_code", "query", "subtitle_origin"}, }, - TargetYoutubeTranscript: { - Group: "YouTube", - ResponseFormat: "json", - Parameters: []string{"callback_url", "language_code", "query", "transcript_origin"}, - }, - TargetYoutubeVideo: { - Group: "None", - ResponseFormat: "json", - Parameters: []string{"callback_url", "geo", "query"}, - }, } diff --git a/responses.go b/responses.go index e55e185..79f2ef2 100644 --- a/responses.go +++ b/responses.go @@ -2,18 +2,18 @@ package decodo // ResultEntry represents a single result from a scrape operation. type ResultEntry struct { - Content interface{} `json:"content"` - StatusCode int `json:"status_code"` - URL string `json:"url,omitempty"` - TaskID string `json:"task_id"` - Headers map[string]string `json:"headers,omitempty"` - Cookies []map[string]string `json:"cookies,omitempty"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` - Help string `json:"help,omitempty"` - BrowserActionsWarnings []map[string]string `json:"browser_actions_warnings,omitempty"` - BrowserActionsError []map[string]string `json:"browser_actions_error,omitempty"` - DeliveryZip string `json:"delivery_zip,omitempty"` + Content interface{} `json:"content"` + StatusCode int `json:"status_code"` + URL string `json:"url,omitempty"` + TaskID string `json:"task_id"` + Headers map[string]string `json:"headers,omitempty"` + Cookies []map[string]interface{} `json:"cookies,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Help string `json:"help,omitempty"` + BrowserActionsWarnings []map[string]string `json:"browser_actions_warnings,omitempty"` + BrowserActionsError []map[string]string `json:"browser_actions_error,omitempty"` + DeliveryZip string `json:"delivery_zip,omitempty"` } // SyncResponse is returned from synchronous scrape requests. diff --git a/targets.go b/targets.go index 6663f2a..d7fe641 100644 --- a/targets.go +++ b/targets.go @@ -8,58 +8,46 @@ type Target string // Target constants for all supported scrape targets. const ( - TargetAirbnb Target = "airbnb" - TargetAmazon Target = "amazon" - TargetAmazonBestsellers Target = "amazon_bestsellers" - TargetAmazonPricing Target = "amazon_pricing" - TargetAmazonProduct Target = "amazon_product" - TargetAmazonSearch Target = "amazon_search" - TargetAmazonSellers Target = "amazon_sellers" - TargetAppleAppStore Target = "apple_app_store" - TargetAutotrader Target = "autotrader" - TargetBbb Target = "bbb" - TargetBing Target = "bing" - TargetBingSearch Target = "bing_search" - TargetChatgpt Target = "chatgpt" - TargetEcommerce Target = "ecommerce" - TargetGemini Target = "gemini" - TargetGoogle Target = "google" - TargetGoogleAds Target = "google_ads" - TargetGoogleAiMode Target = "google_ai_mode" - TargetGoogleLens Target = "google_lens" - TargetGoogleMaps Target = "google_maps" - TargetGoogleSearch Target = "google_search" - TargetGoogleShoppingProduct Target = "google_shopping_product" - TargetGoogleShoppingSearch Target = "google_shopping_search" - TargetGoogleSuggest Target = "google_suggest" + TargetAirbnb Target = "airbnb" + TargetAmazon Target = "amazon" + TargetAmazonBestsellers Target = "amazon_bestsellers" + TargetAmazonPricing Target = "amazon_pricing" + TargetAmazonProduct Target = "amazon_product" + TargetAmazonSearch Target = "amazon_search" + TargetAmazonSellers Target = "amazon_sellers" + TargetAppleAppStore Target = "apple_app_store" + TargetAutotrader Target = "autotrader" + TargetBbb Target = "bbb" + TargetBing Target = "bing" + TargetBingSearch Target = "bing_search" + TargetChatgpt Target = "chatgpt" + TargetGemini Target = "gemini" + TargetGoogle Target = "google" + TargetGoogleAds Target = "google_ads" + TargetGoogleAiMode Target = "google_ai_mode" + TargetGoogleLens Target = "google_lens" + TargetGoogleSearch Target = "google_search" TargetGoogleTravelHotels Target = "google_travel_hotels" - TargetGoogleTrendsExplore Target = "google_trends_explore" - TargetInstagramGraphqlProfile Target = "instagram_graphql_profile" - TargetLowesSearch Target = "lowes_search" - TargetMobile Target = "mobile" - TargetPerplexity Target = "perplexity" - TargetRedditPost Target = "reddit_post" - TargetRedditSubreddit Target = "reddit_subreddit" - TargetRedditUser Target = "reddit_user" - TargetTarget Target = "target" - TargetTargetProduct Target = "target_product" - TargetTargetSearch Target = "target_search" - TargetTiktok Target = "tiktok" - TargetTiktokPost Target = "tiktok_post" - TargetTiktokShopProduct Target = "tiktok_shop_product" - TargetTiktokShopSearch Target = "tiktok_shop_search" - TargetUniversal Target = "universal" - TargetUniversalEcommerce Target = "universal_ecommerce" - TargetWalmart Target = "walmart" - TargetWalmartProduct Target = "walmart_product" - TargetWalmartSearch Target = "walmart_search" - TargetYoutubeChannel Target = "youtube_channel" - TargetYoutubeMetadata Target = "youtube_metadata" - TargetYoutubeSearch Target = "youtube_search" - TargetYoutubeSearchMax Target = "youtube_search_max" - TargetYoutubeSubtitles Target = "youtube_subtitles" - TargetYoutubeTranscript Target = "youtube_transcript" - TargetYoutubeVideo Target = "youtube_video" + TargetMobile Target = "mobile" + TargetPerplexity Target = "perplexity" + TargetRedditPost Target = "reddit_post" + TargetRedditSubreddit Target = "reddit_subreddit" + TargetRedditUser Target = "reddit_user" + TargetTarget Target = "target" + TargetTargetProduct Target = "target_product" + TargetTargetSearch Target = "target_search" + TargetTiktok Target = "tiktok" + TargetTiktokPost Target = "tiktok_post" + TargetTiktokShopProduct Target = "tiktok_shop_product" + TargetTiktokShopSearch Target = "tiktok_shop_search" + TargetUniversal Target = "universal" + TargetWalmart Target = "walmart" + TargetWalmartProduct Target = "walmart_product" + TargetWalmartSearch Target = "walmart_search" + TargetYoutubeChannel Target = "youtube_channel" + TargetYoutubeMetadata Target = "youtube_metadata" + TargetYoutubeSearch Target = "youtube_search" + TargetYoutubeSubtitles Target = "youtube_subtitles" ) // Targets contains all available scrape targets. @@ -77,21 +65,13 @@ var Targets = []Target{ TargetBing, TargetBingSearch, TargetChatgpt, - TargetEcommerce, TargetGemini, TargetGoogle, TargetGoogleAds, TargetGoogleAiMode, TargetGoogleLens, - TargetGoogleMaps, TargetGoogleSearch, - TargetGoogleShoppingProduct, - TargetGoogleShoppingSearch, - TargetGoogleSuggest, TargetGoogleTravelHotels, - TargetGoogleTrendsExplore, - TargetInstagramGraphqlProfile, - TargetLowesSearch, TargetMobile, TargetPerplexity, TargetRedditPost, @@ -105,15 +85,11 @@ var Targets = []Target{ TargetTiktokShopProduct, TargetTiktokShopSearch, TargetUniversal, - TargetUniversalEcommerce, TargetWalmart, TargetWalmartProduct, TargetWalmartSearch, TargetYoutubeChannel, TargetYoutubeMetadata, TargetYoutubeSearch, - TargetYoutubeSearchMax, TargetYoutubeSubtitles, - TargetYoutubeTranscript, - TargetYoutubeVideo, }