diff --git a/legacy/src/services/clearbit-client.ts b/legacy/src/services/clearbit-client.ts index c945df14..52337f70 100644 --- a/legacy/src/services/clearbit-client.ts +++ b/legacy/src/services/clearbit-client.ts @@ -5,9 +5,9 @@ import type { DeepNullable, KyInstance } from '../types.js' import { assert, delay, getEnv, throttleKy } from '../utils.js' export namespace clearbit { - // Allow up to 20 requests per minute by default. + // Allow up to 600 requests per minute by default. export const throttle = pThrottle({ - limit: 20, + limit: 600, interval: 60 * 1000 }) @@ -535,7 +535,8 @@ export class ClearbitClient { this.ky = throttledKy.extend({ timeout: timeoutMs, headers: { - Authorization: `Basic ${Buffer.from(`${apiKey}:`).toString('base64')}` + // Authorization: `Basic ${Buffer.from(`${apiKey}:`).toString('base64')}` + Authorization: `Bearer ${apiKey}` } }) } @@ -546,7 +547,6 @@ export class ClearbitClient { searchParams: { ...options } }) .json() - .catch((_) => undefined) } async companySearch(options: clearbit.CompanySearchOptions) { @@ -642,7 +642,7 @@ export class ClearbitClient { .catch((_) => undefined) } - async revealCompanyFromIp(ip: string) { + async revealCompanyFromIP(ip: string) { return this.ky .get('https://reveal.clearbit.com/v1/companies/find', { searchParams: { ip } diff --git a/legacy/src/services/dexa-client.ts b/legacy/src/services/dexa-client.ts index 6acf3cae..d43afb1d 100644 --- a/legacy/src/services/dexa-client.ts +++ b/legacy/src/services/dexa-client.ts @@ -19,7 +19,10 @@ export class DexaClient { timeoutMs?: number ky?: KyInstance } = {}) { - assert(apiKey, 'DexaClient missing required "apiKey"') + assert( + apiKey, + 'DexaClient missing required "apiKey" (defaults to "DEXA_API_KEY")' + ) this.apiKey = apiKey this.apiBaseUrl = apiBaseUrl diff --git a/legacy/src/services/diffbot-client.ts b/legacy/src/services/diffbot-client.ts index da90cba9..56afce90 100644 --- a/legacy/src/services/diffbot-client.ts +++ b/legacy/src/services/diffbot-client.ts @@ -351,7 +351,10 @@ export class DiffbotClient { throttle?: boolean ky?: KyInstance } = {}) { - assert(apiKey, `DiffbotClient missing required "apiKey"`) + assert( + apiKey, + `DiffbotClient missing required "apiKey" (defaults to "DIFFBOT_API_KEY")` + ) this.apiKey = apiKey this.apiBaseUrl = apiBaseUrl diff --git a/legacy/src/services/exa-client.ts b/legacy/src/services/exa-client.ts index a516fe2d..76d0495e 100644 --- a/legacy/src/services/exa-client.ts +++ b/legacy/src/services/exa-client.ts @@ -143,7 +143,10 @@ export class ExaClient { apiBaseUrl?: string ky?: KyInstance } = {}) { - assert(apiKey, 'ExaClient missing required "apiKey"') + assert( + apiKey, + 'ExaClient missing required "apiKey" (defaults to "EXA_API_KEY")' + ) this.apiKey = apiKey this.apiBaseUrl = apiBaseUrl diff --git a/legacy/src/services/people-data-labs-client.ts b/legacy/src/services/people-data-labs-client.ts index 195f53be..4e74c79d 100644 --- a/legacy/src/services/people-data-labs-client.ts +++ b/legacy/src/services/people-data-labs-client.ts @@ -449,7 +449,10 @@ export class PeopleDataLabsClient { throttle?: boolean ky?: KyInstance } = {}) { - assert(apiKey, 'PeopleDataLabsClient missing required "apiKey"') + assert( + apiKey, + 'PeopleDataLabsClient missing required "apiKey" (defaults to "PEOPLE_DATA_LABS_API_KEY")' + ) this.apiKey = apiKey this.apiBaseUrl = apiBaseUrl diff --git a/legacy/src/services/perigon-client.ts b/legacy/src/services/perigon-client.ts index 54a863fe..23ed9501 100644 --- a/legacy/src/services/perigon-client.ts +++ b/legacy/src/services/perigon-client.ts @@ -273,7 +273,10 @@ export class PerigonClient { timeoutMs?: number ky?: KyInstance } = {}) { - assert(apiKey, 'Error PerigonClient missing required "apiKey"') + assert( + apiKey, + 'PerigonClient missing required "apiKey" (defaults to "PERIGON_API_KEY")' + ) this.apiKey = apiKey diff --git a/legacy/src/services/proxycurl-client.ts b/legacy/src/services/proxycurl-client.ts index 2de52eef..ab6e3dbb 100644 --- a/legacy/src/services/proxycurl-client.ts +++ b/legacy/src/services/proxycurl-client.ts @@ -7,7 +7,7 @@ import { assert, getEnv, throttleKy } from '../utils.js' // All proxycurl types are auto-generated from their openapi spec export namespace proxycurl { - // Allow up to 1500 requests per minute by default. + // Allow up to 300 requests per minute by default (enforced at 5 minute intervals). export const throttle = pThrottle({ limit: 1500, interval: 5 * 60 * 1000 diff --git a/legacy/src/services/serpapi-client.ts b/legacy/src/services/serpapi-client.ts index b84eab9e..659f5776 100644 --- a/legacy/src/services/serpapi-client.ts +++ b/legacy/src/services/serpapi-client.ts @@ -649,7 +649,10 @@ export class SerpAPIClient extends AIFunctionsProvider { apiBaseUrl?: string ky?: KyInstance } & serpapi.ClientParams = {}) { - assert(apiKey, 'Error SerpAPIClient missing required "apiKey"') + assert( + apiKey, + 'SerpAPIClient missing required "apiKey" (defaults to "SERPAPI_API_KEY")' + ) super() this.apiKey = apiKey diff --git a/legacy/src/services/serper-client.ts b/legacy/src/services/serper-client.ts index b4df6df4..7d0495d7 100644 --- a/legacy/src/services/serper-client.ts +++ b/legacy/src/services/serper-client.ts @@ -227,7 +227,7 @@ export class SerperClient extends AIFunctionsProvider { } & serper.ClientParams = {}) { assert( apiKey, - 'SerperClient missing required "apiKey" (defaults to "SERPER_API_KEY" env var)' + 'SerperClient missing required "apiKey" (defaults to "SERPER_API_KEY")' ) super()