diff --git a/GENERATION_REPORT.md b/GENERATION_REPORT.md index ef8d13b..8067ca3 100644 --- a/GENERATION_REPORT.md +++ b/GENERATION_REPORT.md @@ -1,9 +1,10 @@ # Generation Report -Generated at: 2026-10-26T07:24:50Z +Generated at: 2026-11-02T07:05:26Z -## APIs generated (67) +## APIs generated (69) - chat-gpt-chat +- google-gemini - bing-serp - yellowpages-place - yellowpages-search @@ -51,6 +52,7 @@ Generated at: 2026-10-26T07:24:50Z - instagram-comments - instagram-posts - instagram-profile +- instagram-reels - tiktok-comments - tiktok-posts - tiktok-profile diff --git a/cmd/gen_booking_search.go b/cmd/gen_booking_search.go index 081f008..a4274a0 100644 --- a/cmd/gen_booking_search.go +++ b/cmd/gen_booking_search.go @@ -33,6 +33,7 @@ func newBookingSearchCmd() *cobra.Command { var p_keywordVar string var p_languageVar string var p_mealsVar []string + var p_nextPageTokenVar string var p_onlinePaymentVar []string var p_pageVar int var p_price_maxVar float64 @@ -173,6 +174,9 @@ func newBookingSearchCmd() *cobra.Command { params.Add("meals"+"[]", v) } } + if c.Flags().Changed("next-page-token") { + params.Set("nextPageToken", p_nextPageTokenVar) + } if c.Flags().Changed("online-payment") { for _, v := range p_onlinePaymentVar { params.Add("onlinePayment"+"[]", v) @@ -269,11 +273,12 @@ func newBookingSearchCmd() *cobra.Command { _ = cmd.RegisterFlagCompletionFunc("meals", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) { return []string{"breakfastIncluded", "kitchenFacilities"}, cobra.ShellCompDirectiveNoFileComp }) + cmd.Flags().StringVar(&p_nextPageTokenVar, "next-page-token", "", "nextPageToken Next Page Token: Recommended way to paginate. Omit it on the first request; the response returns 'pagination.nextPageToken', which you pass back here to fetch the next page. When a successful response omits the token, the last page has been reached. If a token has expired, the request fails with an error — start again without 'nextPageToken'.") cmd.Flags().StringSliceVar(&p_onlinePaymentVar, "online-payment", nil, "onlinePayment[] Online Payment: Filter by online payment options.") _ = cmd.RegisterFlagCompletionFunc("online-payment", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) { return []string{"acceptsOnlinePayments"}, cobra.ShellCompDirectiveNoFileComp }) - cmd.Flags().IntVar(&p_pageVar, "page", 0, "page Page Number: Page number of the search results. Booking.com returns 25 results per page; pass '2' for results 26–50, '3' for 51–75, etc.") + cmd.Flags().IntVar(&p_pageVar, "page", 0, "page Page Number: Legacy pagination. Booking.com returns 25 results per page; pass '2' for results 26–50, '3' for 51–75, etc. On large destinations this returns duplicate properties across pages — use 'nextPageToken' instead. Ignored when 'nextPageToken' is provided.") cmd.Flags().Float64Var(&p_price_maxVar, "price-max", 0, "price[max] Price Max: Maximum total price for the stay, in the requested 'currency'. Must be '>= 20' and greater than 'price[min]'. Required if 'price[min]' is omitted.") cmd.Flags().Float64Var(&p_price_minVar, "price-min", 0, "price[min] Price Min: Minimum total price for the stay, in the requested 'currency'. Must be '>= 10'. Required if 'price[max]' is omitted.") cmd.Flags().StringSliceVar(&p_propertyAccessibilityVar, "property-accessibility", nil, "propertyAccessibility[] Property Accessibility: Filter by property-level accessibility features. Multiple values are combined with OR.") diff --git a/cmd/gen_google_gemini.go b/cmd/gen_google_gemini.go new file mode 100644 index 0000000..b253a9b --- /dev/null +++ b/cmd/gen_google_gemini.go @@ -0,0 +1,65 @@ +// Code generated by internal/gen. DO NOT EDIT. + +package cmd + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + + "github.com/spf13/cobra" +) + +var ( + _ = json.Marshal + _ = fmt.Sprintf + _ = url.Values{} + _ = strconv.Itoa +) + +func newGoogleGeminiCmd() *cobra.Command { + var p_hlVar string + var p_promptVar string + var p_subsequentRequestTokenVar string + + cmd := &cobra.Command{ + Use: "google-gemini", + Short: "Google Gemini Scraper API (10 credits/call)", + Long: "The Google Gemini Scraper API sends a prompt to Google Gemini and returns the answer as markdown text, together with the web sources Gemini cited and any images it showed. No Google account is needed, and a conversation can be continued across requests.\n\nEndpoint: GET https://api.hasdata.com/scrape/gemini/chat\nCost: 10 credits per call.", + Args: cobra.NoArgs, + PreRunE: func(c *cobra.Command, _ []string) error { + return nil + }, + RunE: func(c *cobra.Command, _ []string) error { + ctx := c.Context() + cli, err := Client() + if err != nil { + return err + } + params := url.Values{} + if c.Flags().Changed("hl") { + params.Set("hl", p_hlVar) + } + params.Set("prompt", p_promptVar) + if c.Flags().Changed("subsequent-request-token") { + params.Set("subsequentRequestToken", p_subsequentRequestTokenVar) + } + resp, err := cli.Do(ctx, "GET", "https://api.hasdata.com/scrape/gemini/chat", params, nil) + if err != nil { + return err + } + return WriteResponse(c, resp) + }, + } + cmd.Flags().StringVar(&p_hlVar, "hl", "en-US", "hl Language: Interface language for the answer, as a BCP-47 locale such as 'en-US' or 'de-DE'. The answer language also follows the language of the prompt.") + cmd.Flags().StringVar(&p_promptVar, "prompt", "What are the best-rated things to do in Buenos Aires?", "prompt Prompt: The question or instruction to send to Google Gemini, up to 8000 characters. A prompt that asks about recent events makes Gemini search the web and return sources; a general-knowledge prompt is answered from the model alone. The prompt also decides the language of the answer — write it in the language you want back, or ask for one explicitly. (required)") + _ = cmd.MarkFlagRequired("prompt") + cmd.Flags().StringVar(&p_subsequentRequestTokenVar, "subsequent-request-token", "", "subsequentRequestToken Subsequent Request Token: Token returned in a previous answer as 'subsequentRequestToken'. Pass it back to continue that conversation, so Gemini answers the new prompt with the earlier turns in context. Omit it to start a fresh conversation.") + + return cmd +} + +func init() { + RegisterAPICommand("ai", "AI", newGoogleGeminiCmd()) +} diff --git a/cmd/gen_instagram_comments.go b/cmd/gen_instagram_comments.go index ea577dd..743bae1 100644 --- a/cmd/gen_instagram_comments.go +++ b/cmd/gen_instagram_comments.go @@ -26,7 +26,7 @@ func newInstagramCommentsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "instagram-comments", Short: "Instagram Comments Scraper API (10 credits/call)", - Long: "The Instagram Comments Scraper API returns the comments on a public Instagram post or reel by its URL. The first page also returns the post itself with caption, likes and comments counts, and every image or video in the post, including all carousel items. Each comment includes its text, like count, reply count, timestamp, and author (with a link to the author's profile). Results are paginated with a token.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/comments\nCost: 10 credits per call.", + Long: "The Instagram Comments Scraper API returns the comments on a public Instagram post or reel by its URL. The first page also returns the post itself with caption, likes and comments counts, and every image or video in the post, including all carousel items, and a link to the post owner's reels on the Instagram Reels Scraper API. Each comment includes its text, like count, reply count, timestamp, and author (with a link to the author's profile). Results are paginated with a token.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/comments\nCost: 10 credits per call.", Args: cobra.NoArgs, PreRunE: func(c *cobra.Command, _ []string) error { return nil diff --git a/cmd/gen_instagram_posts.go b/cmd/gen_instagram_posts.go index 3008249..d07263a 100644 --- a/cmd/gen_instagram_posts.go +++ b/cmd/gen_instagram_posts.go @@ -26,7 +26,7 @@ func newInstagramPostsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "instagram-posts", Short: "Instagram Posts Scraper API (10 credits/call)", - Long: "The Instagram Posts Scraper API lets you retrieve the latest posts of a public Instagram account using its handle. It returns posts with captions, hashtags, mentions, likes, comments, and plays counts, image and video URLs, and timestamps, with token-based pagination for retrieving older posts.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/posts\nCost: 10 credits per call.", + Long: "The Instagram Posts Scraper API lets you retrieve the latest posts of a public Instagram account using its handle. It returns posts with captions, hashtags, mentions, like and comment counts, image and video URLs, and timestamps, with token-based pagination for retrieving older posts.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/posts\nCost: 10 credits per call.", Args: cobra.NoArgs, PreRunE: func(c *cobra.Command, _ []string) error { return nil @@ -54,7 +54,7 @@ func newInstagramPostsCmd() *cobra.Command { } cmd.Flags().StringVar(&p_handleVar, "handle", "hasdatadotcom", "handle Instagram Handle: The Instagram username of the account whose posts you want to scrape, without the '@' symbol. (required)") _ = cmd.MarkFlagRequired("handle") - cmd.Flags().IntVar(&p_limitVar, "limit", 12, "limit Results Limit: The maximum number of posts to retrieve per request. Defaults to 12.") + cmd.Flags().IntVar(&p_limitVar, "limit", 12, "limit Results Limit: The maximum number of posts to retrieve per request, up to 12. Defaults to 12.") cmd.Flags().StringVar(&p_nextPageTokenVar, "next-page-token", "", "nextPageToken Next Page Token: Defines the next page token. It is used for retrieving the next page results. Use the 'nextPageToken' value returned by the previous response.") return cmd diff --git a/cmd/gen_instagram_profile.go b/cmd/gen_instagram_profile.go index 8d06178..2d41860 100644 --- a/cmd/gen_instagram_profile.go +++ b/cmd/gen_instagram_profile.go @@ -24,7 +24,7 @@ func newInstagramProfileCmd() *cobra.Command { cmd := &cobra.Command{ Use: "instagram-profile", Short: "Instagram Profile Scraper API (10 credits/call)", - Long: "The Instagram Profile Scraper API lets you retrieve public profile information for a specific Instagram account using its handle. It returns data such as bio, followers, following, posts count, and other visible profile details.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/profile\nCost: 10 credits per call.", + Long: "The Instagram Profile Scraper API lets you retrieve public profile information for a specific Instagram account using its handle. It returns data such as bio, followers, following, posts count, and other visible profile details. Public profiles also include a link to the account's reels on the Instagram Reels Scraper API.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/profile\nCost: 10 credits per call.", Args: cobra.NoArgs, PreRunE: func(c *cobra.Command, _ []string) error { return nil diff --git a/cmd/gen_instagram_reels.go b/cmd/gen_instagram_reels.go new file mode 100644 index 0000000..09fb1cf --- /dev/null +++ b/cmd/gen_instagram_reels.go @@ -0,0 +1,65 @@ +// Code generated by internal/gen. DO NOT EDIT. + +package cmd + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + + "github.com/spf13/cobra" +) + +var ( + _ = json.Marshal + _ = fmt.Sprintf + _ = url.Values{} + _ = strconv.Itoa +) + +func newInstagramReelsCmd() *cobra.Command { + var p_handleVar string + var p_limitVar int + var p_nextPageTokenVar string + + cmd := &cobra.Command{ + Use: "instagram-reels", + Short: "Instagram Reels Scraper API (10 credits/call)", + Long: "The Instagram Reels Scraper API lets you retrieve the Reels of a public Instagram account using its handle, in the order of the account's Reels tab. It returns each reel with play, like and comment counts, caption, hashtags, mentions, cover image, video URL, owner, tagged users, and timestamp, with token-based pagination for retrieving older reels.\n\nEndpoint: GET https://api.hasdata.com/scrape/instagram/reels\nCost: 10 credits per call.", + Args: cobra.NoArgs, + PreRunE: func(c *cobra.Command, _ []string) error { + return nil + }, + RunE: func(c *cobra.Command, _ []string) error { + ctx := c.Context() + cli, err := Client() + if err != nil { + return err + } + params := url.Values{} + params.Set("handle", p_handleVar) + if c.Flags().Changed("limit") { + params.Set("limit", strconv.Itoa(p_limitVar)) + } + if c.Flags().Changed("next-page-token") { + params.Set("nextPageToken", p_nextPageTokenVar) + } + resp, err := cli.Do(ctx, "GET", "https://api.hasdata.com/scrape/instagram/reels", params, nil) + if err != nil { + return err + } + return WriteResponse(c, resp) + }, + } + cmd.Flags().StringVar(&p_handleVar, "handle", "hasdatadotcom", "handle Instagram Handle: The Instagram username of the account whose reels you want to scrape, without the '@' symbol. (required)") + _ = cmd.MarkFlagRequired("handle") + cmd.Flags().IntVar(&p_limitVar, "limit", 12, "limit Results Limit: The maximum number of reels to retrieve per request, up to 12. Defaults to 12.") + cmd.Flags().StringVar(&p_nextPageTokenVar, "next-page-token", "", "nextPageToken Next Page Token: Defines the next page token. It is used for retrieving the next page results. Use the 'nextPageToken' value returned by the previous response.") + + return cmd +} + +func init() { + RegisterAPICommand("social", "Social", newInstagramReelsCmd()) +} diff --git a/internal/gen/spec-hash.txt b/internal/gen/spec-hash.txt index 3d43aab..d20c6e8 100644 --- a/internal/gen/spec-hash.txt +++ b/internal/gen/spec-hash.txt @@ -1 +1 @@ -e644a4f3b9db7312df052b0b4f4b9cd344fef55634dc58ab30aa80abe0a3a3e1 +1ae4931ea01969e96c19cba85bbbc3e4d3e5927257372d089d1986f90bc2d465 diff --git a/pr-body.md b/pr-body.md index 789be3e..867c40e 100644 --- a/pr-body.md +++ b/pr-body.md @@ -1,18 +1,22 @@ ## Changes - GENERATION_REPORT.md | 2 +- - cmd/gen_google_serp.go | 15 +++++++++ - internal/gen/spec-hash.txt | 2 +- - pr-body.md | 84 ---------------------------------------------- - 4 files changed, 17 insertions(+), 86 deletions(-) + GENERATION_REPORT.md | 6 ++-- + cmd/gen_booking_search.go | 7 +++- + cmd/gen_instagram_comments.go | 2 +- + cmd/gen_instagram_posts.go | 4 +-- + cmd/gen_instagram_profile.go | 2 +- + internal/gen/spec-hash.txt | 2 +- + pr-body.md | 79 ------------------------------------------- + 7 files changed, 15 insertions(+), 87 deletions(-) ## Generation Report # Generation Report -Generated at: 2026-10-26T07:24:50Z +Generated at: 2026-11-02T07:05:26Z -## APIs generated (67) +## APIs generated (69) - chat-gpt-chat +- google-gemini - bing-serp - yellowpages-place - yellowpages-search @@ -60,6 +64,7 @@ Generated at: 2026-10-26T07:24:50Z - instagram-comments - instagram-posts - instagram-profile +- instagram-reels - tiktok-comments - tiktok-posts - tiktok-profile