scrapebadger 0.65.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2833,6 +2833,8 @@ interface RedditPost {
2833
2833
  selftext: string;
2834
2834
  /** Self post text as HTML */
2835
2835
  selftext_html: string | null;
2836
+ /** Preview excerpt returned by Reddit's web search; distinct from the full selftext. */
2837
+ search_snippet?: string | null;
2836
2838
  /** External or self URL */
2837
2839
  url: string;
2838
2840
  /** Permalink to post on Reddit */
@@ -3101,6 +3103,9 @@ interface RedditSubreddit {
3101
3103
  url: string;
3102
3104
  /** Subscriber count */
3103
3105
  subscribers: number;
3106
+ /** Weekly activity from Reddit's web search, separate from subscriber count. */
3107
+ weekly_visitors?: number | null;
3108
+ weekly_contributions?: number | null;
3104
3109
  /** Creation timestamp (Unix) */
3105
3110
  created_utc: number;
3106
3111
  /** Creation time as ISO 8601 UTC string */
@@ -3565,6 +3570,8 @@ interface DomainPostsResponse {
3565
3570
  domain: string;
3566
3571
  }
3567
3572
 
3573
+ /** Search cursors are opaque, expire after 30 minutes, and require the same query and filters.
3574
+ * Native pages can contain fewer results than limit; continue while pagination.after is present. */
3568
3575
  /**
3569
3576
  * Reddit Search API client.
3570
3577
  *
@@ -17757,16 +17764,29 @@ declare class LoopNetClient {
17757
17764
  * Perplexity API client. // --- BEGIN generated by sdk/codegen/facade — do not edit ---
17758
17765
  */
17759
17766
 
17767
+ /**
17768
+ * Query parameters for the Perplexity GET methods.
17769
+ *
17770
+ * `country` is best-effort: when that market has no exit left, another one
17771
+ * answers and the response `country` says which. Set `strictCountry: true`
17772
+ * to answer only from an exit in `country` (required with it); when none
17773
+ * answers in time the call fails with HTTP 503 `country_unavailable` and is
17774
+ * not billed. On the POST forms, put `strict_country: true` in the body.
17775
+ */
17776
+ type PerplexityParams = Record<string, string | number | boolean | undefined> & {
17777
+ /** Answer only from an exit in `country`, never another one. Sent only when true. */
17778
+ strictCountry?: boolean;
17779
+ };
17760
17780
  /** Client for all Perplexity API operations. (Generated from the OpenAPI spec.) */
17761
17781
  declare class PerplexityClient {
17762
17782
  private readonly client;
17763
17783
  constructor(client: BaseClient);
17764
17784
  /** Ask Perplexity a question. Generated from the OpenAPI spec; returns the raw response object. */
17765
- askPerplexityAQuestion(params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17785
+ askPerplexityAQuestion(params?: PerplexityParams): Promise<Record<string, unknown>>;
17766
17786
  /** Ask Perplexity a question (POST). Generated from the OpenAPI spec; returns the raw response object. */
17767
17787
  askPerplexityAQuestionPost(body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17768
17788
  /** Measure a brand's visibility in a Perplexity answer. Generated from the OpenAPI spec; returns the raw response object. */
17769
- measureABrandSVisibilityInAPerplexityAnswer(params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17789
+ measureABrandSVisibilityInAPerplexityAnswer(params?: PerplexityParams): Promise<Record<string, unknown>>;
17770
17790
  /** Measure a brand's visibility in a Perplexity answer (POST). Generated from the OpenAPI spec; returns the raw response object. */
17771
17791
  measureABrandSVisibilityInAPerplexityAnswerPost(body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17772
17792
  }
package/dist/index.d.ts CHANGED
@@ -2833,6 +2833,8 @@ interface RedditPost {
2833
2833
  selftext: string;
2834
2834
  /** Self post text as HTML */
2835
2835
  selftext_html: string | null;
2836
+ /** Preview excerpt returned by Reddit's web search; distinct from the full selftext. */
2837
+ search_snippet?: string | null;
2836
2838
  /** External or self URL */
2837
2839
  url: string;
2838
2840
  /** Permalink to post on Reddit */
@@ -3101,6 +3103,9 @@ interface RedditSubreddit {
3101
3103
  url: string;
3102
3104
  /** Subscriber count */
3103
3105
  subscribers: number;
3106
+ /** Weekly activity from Reddit's web search, separate from subscriber count. */
3107
+ weekly_visitors?: number | null;
3108
+ weekly_contributions?: number | null;
3104
3109
  /** Creation timestamp (Unix) */
3105
3110
  created_utc: number;
3106
3111
  /** Creation time as ISO 8601 UTC string */
@@ -3565,6 +3570,8 @@ interface DomainPostsResponse {
3565
3570
  domain: string;
3566
3571
  }
3567
3572
 
3573
+ /** Search cursors are opaque, expire after 30 minutes, and require the same query and filters.
3574
+ * Native pages can contain fewer results than limit; continue while pagination.after is present. */
3568
3575
  /**
3569
3576
  * Reddit Search API client.
3570
3577
  *
@@ -17757,16 +17764,29 @@ declare class LoopNetClient {
17757
17764
  * Perplexity API client. // --- BEGIN generated by sdk/codegen/facade — do not edit ---
17758
17765
  */
17759
17766
 
17767
+ /**
17768
+ * Query parameters for the Perplexity GET methods.
17769
+ *
17770
+ * `country` is best-effort: when that market has no exit left, another one
17771
+ * answers and the response `country` says which. Set `strictCountry: true`
17772
+ * to answer only from an exit in `country` (required with it); when none
17773
+ * answers in time the call fails with HTTP 503 `country_unavailable` and is
17774
+ * not billed. On the POST forms, put `strict_country: true` in the body.
17775
+ */
17776
+ type PerplexityParams = Record<string, string | number | boolean | undefined> & {
17777
+ /** Answer only from an exit in `country`, never another one. Sent only when true. */
17778
+ strictCountry?: boolean;
17779
+ };
17760
17780
  /** Client for all Perplexity API operations. (Generated from the OpenAPI spec.) */
17761
17781
  declare class PerplexityClient {
17762
17782
  private readonly client;
17763
17783
  constructor(client: BaseClient);
17764
17784
  /** Ask Perplexity a question. Generated from the OpenAPI spec; returns the raw response object. */
17765
- askPerplexityAQuestion(params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17785
+ askPerplexityAQuestion(params?: PerplexityParams): Promise<Record<string, unknown>>;
17766
17786
  /** Ask Perplexity a question (POST). Generated from the OpenAPI spec; returns the raw response object. */
17767
17787
  askPerplexityAQuestionPost(body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17768
17788
  /** Measure a brand's visibility in a Perplexity answer. Generated from the OpenAPI spec; returns the raw response object. */
17769
- measureABrandSVisibilityInAPerplexityAnswer(params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17789
+ measureABrandSVisibilityInAPerplexityAnswer(params?: PerplexityParams): Promise<Record<string, unknown>>;
17770
17790
  /** Measure a brand's visibility in a Perplexity answer (POST). Generated from the OpenAPI spec; returns the raw response object. */
17771
17791
  measureABrandSVisibilityInAPerplexityAnswerPost(body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
17772
17792
  }
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
10
10
 
11
11
  // src/internal/version.ts
12
- var SDK_VERSION = "0.65.0";
12
+ var SDK_VERSION = "0.67.0";
13
13
 
14
14
  // src/internal/exceptions.ts
15
15
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -3884,10 +3884,10 @@ var SearchClient3 = class {
3884
3884
  async posts(options) {
3885
3885
  return this.client.request("/v1/reddit/search/posts", {
3886
3886
  params: {
3887
- query: options.query,
3887
+ q: options.query,
3888
3888
  subreddit: options.subreddit,
3889
3889
  sort: options.sort,
3890
- time: options.time,
3890
+ t: options.time,
3891
3891
  after: options.after,
3892
3892
  limit: options.limit
3893
3893
  }
@@ -3918,7 +3918,7 @@ var SearchClient3 = class {
3918
3918
  async subreddits(options) {
3919
3919
  return this.client.request("/v1/reddit/search/subreddits", {
3920
3920
  params: {
3921
- query: options.query,
3921
+ q: options.query,
3922
3922
  after: options.after,
3923
3923
  limit: options.limit
3924
3924
  }
@@ -3949,7 +3949,7 @@ var SearchClient3 = class {
3949
3949
  async users(options) {
3950
3950
  return this.client.request("/v1/reddit/search/users", {
3951
3951
  params: {
3952
- query: options.query,
3952
+ q: options.query,
3953
3953
  after: options.after,
3954
3954
  limit: options.limit
3955
3955
  }
@@ -3986,7 +3986,7 @@ var SearchClient3 = class {
3986
3986
  params: {
3987
3987
  domain: options.domain,
3988
3988
  sort: options.sort,
3989
- time: options.time,
3989
+ t: options.time,
3990
3990
  after: options.after,
3991
3991
  limit: options.limit
3992
3992
  }
@@ -9741,6 +9741,10 @@ var LoopNetClient = class {
9741
9741
  };
9742
9742
 
9743
9743
  // src/perplexity/client.ts
9744
+ function toQuery(params) {
9745
+ const { strictCountry, ...rest } = params;
9746
+ return strictCountry ? { ...rest, strict_country: true } : rest;
9747
+ }
9744
9748
  var PerplexityClient = class {
9745
9749
  client;
9746
9750
  constructor(client) {
@@ -9748,7 +9752,7 @@ var PerplexityClient = class {
9748
9752
  }
9749
9753
  /** Ask Perplexity a question. Generated from the OpenAPI spec; returns the raw response object. */
9750
9754
  async askPerplexityAQuestion(params = {}) {
9751
- return this.client.request("/v1/perplexity/ask", { params });
9755
+ return this.client.request("/v1/perplexity/ask", { params: toQuery(params) });
9752
9756
  }
9753
9757
  /** Ask Perplexity a question (POST). Generated from the OpenAPI spec; returns the raw response object. */
9754
9758
  async askPerplexityAQuestionPost(body, params = {}) {
@@ -9756,7 +9760,7 @@ var PerplexityClient = class {
9756
9760
  }
9757
9761
  /** Measure a brand's visibility in a Perplexity answer. Generated from the OpenAPI spec; returns the raw response object. */
9758
9762
  async measureABrandSVisibilityInAPerplexityAnswer(params = {}) {
9759
- return this.client.request("/v1/perplexity/brand-visibility", { params });
9763
+ return this.client.request("/v1/perplexity/brand-visibility", { params: toQuery(params) });
9760
9764
  }
9761
9765
  /** Measure a brand's visibility in a Perplexity answer (POST). Generated from the OpenAPI spec; returns the raw response object. */
9762
9766
  async measureABrandSVisibilityInAPerplexityAnswerPost(body, params = {}) {