diff --git a/packages/builtwith-api/src/index.ts b/packages/builtwith-api/src/index.ts index c6964ba..274a1bb 100644 --- a/packages/builtwith-api/src/index.ts +++ b/packages/builtwith-api/src/index.ts @@ -96,7 +96,7 @@ export function createClient(apiKey: string, moduleParams: ClientOptions = {}): validateLookup(lookup, { multi: true }); if (params) DomainParamsSchema.parse(params); return get( - url("v22", { + url("v23", { LOOKUP: Array.isArray(lookup) ? lookup.join(",") : lookup, ...booleanParams(params, DOMAIN_BOOLEANS), FDRANGE: params?.firstDetectedRange, diff --git a/packages/builtwith-api/src/schemas.ts b/packages/builtwith-api/src/schemas.ts index 25d0e64..ede4f21 100644 --- a/packages/builtwith-api/src/schemas.ts +++ b/packages/builtwith-api/src/schemas.ts @@ -148,6 +148,7 @@ export const FreeResponseSchema = z.strictObject({ export type FreeResponse = z.infer; const TechnologySchema = z.strictObject({ + Id: z.number(), Name: z.string(), Description: z.string(), Link: z.string(), @@ -207,6 +208,15 @@ const AttributesSchema = z.strictObject({ Followers: z.number(), Employees: z.number(), ProductCount: z.number().optional(), + Revenue: z.number().optional(), + PageRank: z.number().optional(), + BWRank: z.number().optional(), + Tranco: z.number().optional(), + BWS: z.number().optional(), + AIMaturity: z.number().optional(), + AIOpenness: z.number().optional(), + AIReadiness: z.number().optional(), + AIVisibility: z.number().optional(), }); /** Validation schema for {@link DomainResponse}. */ diff --git a/packages/builtwith-api/test/params.test.ts b/packages/builtwith-api/test/params.test.ts index dfd6fe9..7fb3d22 100644 --- a/packages/builtwith-api/test/params.test.ts +++ b/packages/builtwith-api/test/params.test.ts @@ -72,10 +72,10 @@ describe("buildURL", () => { }); it("appends query string when params have values", () => { - const result = buildURL("KEY123", "json", "v22", { + const result = buildURL("KEY123", "json", "v23", { LOOKUP: "example.com", }); - expect(result).toBe("https://api.builtwith.com/v22/api.json?KEY=KEY123&LOOKUP=example.com"); + expect(result).toBe("https://api.builtwith.com/v23/api.json?KEY=KEY123&LOOKUP=example.com"); }); it("no trailing & when params are all undefined", () => { diff --git a/packages/builtwith-api/test/schemas.test.ts b/packages/builtwith-api/test/schemas.test.ts index 15176de..1dcf803 100644 --- a/packages/builtwith-api/test/schemas.test.ts +++ b/packages/builtwith-api/test/schemas.test.ts @@ -66,6 +66,7 @@ describe("DomainResponseSchema", () => { { Technologies: [ { + Id: 1515848251, Name: "jQuery", Description: "JS library", Link: "https://jquery.com",