@spyglasshq/sdk 0.1.9 → 0.1.11

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.
Files changed (286) hide show
  1. package/README.md +30 -14
  2. package/dist/cjs/BaseClient.d.ts +4 -4
  3. package/dist/cjs/BaseClient.js +7 -7
  4. package/dist/cjs/Client.d.ts +13 -13
  5. package/dist/cjs/Client.js +46 -64
  6. package/dist/cjs/api/client/index.d.ts +1 -1
  7. package/dist/cjs/api/client/requests/SearchBrandsRequest.d.ts +4 -4
  8. package/dist/cjs/api/client/requests/SearchBrandsRequest.js +6 -6
  9. package/dist/cjs/api/client/requests/SearchCreatorsRequest.d.ts +4 -4
  10. package/dist/cjs/api/client/requests/SearchCreatorsRequest.js +174 -174
  11. package/dist/cjs/api/client/requests/SearchMediaRequest.d.ts +6 -2
  12. package/dist/cjs/api/client/requests/SearchMediaRequest.js +227 -223
  13. package/dist/cjs/api/client/requests/index.d.ts +5 -5
  14. package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
  15. package/dist/cjs/api/errors/BadRequestError.js +2 -2
  16. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +3 -3
  17. package/dist/cjs/api/errors/ContentTooLargeError.js +2 -2
  18. package/dist/cjs/api/errors/ForbiddenError.d.ts +3 -3
  19. package/dist/cjs/api/errors/ForbiddenError.js +2 -2
  20. package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
  21. package/dist/cjs/api/errors/InternalServerError.js +2 -2
  22. package/dist/cjs/api/errors/MethodNotAllowedError.d.ts +3 -3
  23. package/dist/cjs/api/errors/MethodNotAllowedError.js +2 -2
  24. package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
  25. package/dist/cjs/api/errors/NotFoundError.js +2 -2
  26. package/dist/cjs/api/errors/PaymentRequiredError.d.ts +3 -3
  27. package/dist/cjs/api/errors/PaymentRequiredError.js +2 -2
  28. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +3 -3
  29. package/dist/cjs/api/errors/TooManyRequestsError.js +2 -2
  30. package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
  31. package/dist/cjs/api/errors/UnauthorizedError.js +2 -2
  32. package/dist/cjs/api/errors/index.d.ts +9 -9
  33. package/dist/cjs/api/index.d.ts +4 -4
  34. package/dist/cjs/api/resources/account/client/Client.d.ts +67 -7
  35. package/dist/cjs/api/resources/account/client/Client.js +208 -42
  36. package/dist/cjs/api/resources/account/client/index.d.ts +1 -1
  37. package/dist/cjs/api/resources/account/client/requests/CampaignsAccountRequest.d.ts +18 -0
  38. package/dist/cjs/api/resources/account/client/requests/CampaignsAccountRequest.js +3 -0
  39. package/dist/cjs/api/resources/account/client/requests/CollabsAccountRequest.d.ts +12 -0
  40. package/dist/cjs/api/resources/account/client/requests/CollabsAccountRequest.js +3 -0
  41. package/dist/cjs/api/resources/account/client/requests/InsightsAccountRequest.d.ts +1 -1
  42. package/dist/cjs/api/resources/account/client/requests/LandingPagesAccountRequest.d.ts +2 -1
  43. package/dist/cjs/api/resources/account/client/requests/index.d.ts +7 -5
  44. package/dist/cjs/api/resources/account/exports.d.ts +2 -2
  45. package/dist/cjs/api/resources/account/index.d.ts +2 -2
  46. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestDatePreset.d.ts +17 -0
  47. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestDatePreset.js +20 -0
  48. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestSortBy.d.ts +5 -0
  49. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestSortBy.js +8 -0
  50. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestType.d.ts +5 -0
  51. package/dist/cjs/api/resources/account/types/CampaignsAccountRequestType.js +8 -0
  52. package/dist/cjs/api/resources/account/types/CampaignsAccountResponse.d.ts +20 -0
  53. package/dist/cjs/api/resources/account/types/CampaignsAccountResponse.js +3 -0
  54. package/dist/cjs/api/resources/account/types/CollabsAccountResponse.d.ts +14 -0
  55. package/dist/cjs/api/resources/account/types/CollabsAccountResponse.js +3 -0
  56. package/dist/cjs/api/resources/account/types/GetAccountResponse.d.ts +3 -3
  57. package/dist/cjs/api/resources/account/types/IndexAccountResponse.js +2 -2
  58. package/dist/cjs/api/resources/account/types/IndexStatusAccountResponse.js +2 -2
  59. package/dist/cjs/api/resources/account/types/InsightsAccountRequestType.js +4 -4
  60. package/dist/cjs/api/resources/account/types/InsightsAccountResponse.d.ts +2 -12
  61. package/dist/cjs/api/resources/account/types/LandingPagesAccountRequestShowInactive.js +2 -2
  62. package/dist/cjs/api/resources/account/types/index.d.ts +12 -7
  63. package/dist/cjs/api/resources/account/types/index.js +5 -0
  64. package/dist/cjs/api/resources/index.d.ts +3 -3
  65. package/dist/cjs/api/types/Error_.js +11 -11
  66. package/dist/cjs/api/types/SearchBrandsResponse.js +1 -1
  67. package/dist/cjs/api/types/SearchCreatorsResponse.js +1 -1
  68. package/dist/cjs/api/types/SearchMediaResponse.js +26 -26
  69. package/dist/cjs/api/types/index.d.ts +7 -7
  70. package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
  71. package/dist/cjs/auth/BearerAuthProvider.js +2 -2
  72. package/dist/cjs/auth/index.d.ts +1 -1
  73. package/dist/cjs/core/auth/AuthProvider.d.ts +2 -2
  74. package/dist/cjs/core/auth/AuthProvider.js +3 -3
  75. package/dist/cjs/core/auth/BasicAuth.js +7 -7
  76. package/dist/cjs/core/auth/BearerToken.js +1 -1
  77. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +2 -2
  78. package/dist/cjs/core/auth/index.d.ts +5 -5
  79. package/dist/cjs/core/base64.js +4 -4
  80. package/dist/cjs/core/exports.d.ts +1 -1
  81. package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
  82. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +4 -4
  83. package/dist/cjs/core/fetcher/BinaryResponse.js +1 -1
  84. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  85. package/dist/cjs/core/fetcher/EndpointSupplier.js +1 -1
  86. package/dist/cjs/core/fetcher/Fetcher.d.ts +11 -11
  87. package/dist/cjs/core/fetcher/Fetcher.js +50 -56
  88. package/dist/cjs/core/fetcher/Headers.js +10 -10
  89. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +2 -2
  90. package/dist/cjs/core/fetcher/RawResponse.d.ts +1 -1
  91. package/dist/cjs/core/fetcher/RawResponse.js +6 -6
  92. package/dist/cjs/core/fetcher/Supplier.js +1 -1
  93. package/dist/cjs/core/fetcher/createRequestUrl.js +1 -1
  94. package/dist/cjs/core/fetcher/getErrorResponseBody.js +11 -11
  95. package/dist/cjs/core/fetcher/getRequestBody.d.ts +2 -2
  96. package/dist/cjs/core/fetcher/getRequestBody.js +4 -4
  97. package/dist/cjs/core/fetcher/getResponseBody.d.ts +2 -2
  98. package/dist/cjs/core/fetcher/getResponseBody.js +11 -11
  99. package/dist/cjs/core/fetcher/index.d.ts +13 -13
  100. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +2 -2
  101. package/dist/cjs/core/fetcher/makePassthroughRequest.js +7 -7
  102. package/dist/cjs/core/fetcher/makeRequest.js +3 -3
  103. package/dist/cjs/core/fetcher/redactUrl.js +36 -36
  104. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -4
  105. package/dist/cjs/core/fetcher/signals.js +2 -2
  106. package/dist/cjs/core/index.d.ts +6 -6
  107. package/dist/cjs/core/logging/exports.d.ts +1 -1
  108. package/dist/cjs/core/logging/index.d.ts +1 -1
  109. package/dist/cjs/core/logging/logger.js +4 -4
  110. package/dist/cjs/core/requestBody.js +1 -1
  111. package/dist/cjs/core/runtime/index.d.ts +1 -1
  112. package/dist/cjs/core/runtime/runtime.d.ts +1 -1
  113. package/dist/cjs/core/runtime/runtime.js +35 -37
  114. package/dist/cjs/core/url/QueryStringBuilder.d.ts +1 -1
  115. package/dist/cjs/core/url/QueryStringBuilder.js +3 -3
  116. package/dist/cjs/core/url/encodePathParam.js +8 -10
  117. package/dist/cjs/core/url/index.d.ts +4 -4
  118. package/dist/cjs/core/url/join.js +11 -11
  119. package/dist/cjs/core/url/qs.d.ts +1 -1
  120. package/dist/cjs/core/url/qs.js +14 -14
  121. package/dist/cjs/environments.js +1 -1
  122. package/dist/cjs/errors/SpyglassError.d.ts +1 -1
  123. package/dist/cjs/errors/SpyglassError.js +3 -3
  124. package/dist/cjs/errors/SpyglassTimeoutError.d.ts +1 -1
  125. package/dist/cjs/errors/SpyglassTimeoutError.js +1 -1
  126. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +1 -1
  127. package/dist/cjs/errors/handleNonStatusCodeError.js +5 -5
  128. package/dist/cjs/errors/index.d.ts +2 -2
  129. package/dist/cjs/exports.d.ts +1 -1
  130. package/dist/cjs/index.d.ts +6 -6
  131. package/dist/cjs/version.d.ts +1 -1
  132. package/dist/cjs/version.js +1 -1
  133. package/dist/esm/BaseClient.d.mts +4 -4
  134. package/dist/esm/BaseClient.mjs +10 -10
  135. package/dist/esm/Client.d.mts +13 -13
  136. package/dist/esm/Client.mjs +55 -73
  137. package/dist/esm/api/client/index.d.mts +1 -1
  138. package/dist/esm/api/client/index.mjs +1 -1
  139. package/dist/esm/api/client/requests/SearchBrandsRequest.d.mts +4 -4
  140. package/dist/esm/api/client/requests/SearchBrandsRequest.mjs +6 -6
  141. package/dist/esm/api/client/requests/SearchCreatorsRequest.d.mts +4 -4
  142. package/dist/esm/api/client/requests/SearchCreatorsRequest.mjs +174 -174
  143. package/dist/esm/api/client/requests/SearchMediaRequest.d.mts +6 -2
  144. package/dist/esm/api/client/requests/SearchMediaRequest.mjs +227 -223
  145. package/dist/esm/api/client/requests/index.d.mts +5 -5
  146. package/dist/esm/api/client/requests/index.mjs +3 -3
  147. package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
  148. package/dist/esm/api/errors/BadRequestError.mjs +3 -3
  149. package/dist/esm/api/errors/ContentTooLargeError.d.mts +3 -3
  150. package/dist/esm/api/errors/ContentTooLargeError.mjs +3 -3
  151. package/dist/esm/api/errors/ForbiddenError.d.mts +3 -3
  152. package/dist/esm/api/errors/ForbiddenError.mjs +3 -3
  153. package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
  154. package/dist/esm/api/errors/InternalServerError.mjs +3 -3
  155. package/dist/esm/api/errors/MethodNotAllowedError.d.mts +3 -3
  156. package/dist/esm/api/errors/MethodNotAllowedError.mjs +3 -3
  157. package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
  158. package/dist/esm/api/errors/NotFoundError.mjs +3 -3
  159. package/dist/esm/api/errors/PaymentRequiredError.d.mts +3 -3
  160. package/dist/esm/api/errors/PaymentRequiredError.mjs +3 -3
  161. package/dist/esm/api/errors/TooManyRequestsError.d.mts +3 -3
  162. package/dist/esm/api/errors/TooManyRequestsError.mjs +3 -3
  163. package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
  164. package/dist/esm/api/errors/UnauthorizedError.mjs +3 -3
  165. package/dist/esm/api/errors/index.d.mts +9 -9
  166. package/dist/esm/api/errors/index.mjs +9 -9
  167. package/dist/esm/api/index.d.mts +4 -4
  168. package/dist/esm/api/index.mjs +4 -4
  169. package/dist/esm/api/resources/account/client/Client.d.mts +67 -7
  170. package/dist/esm/api/resources/account/client/Client.mjs +216 -50
  171. package/dist/esm/api/resources/account/client/index.d.mts +1 -1
  172. package/dist/esm/api/resources/account/client/index.mjs +1 -1
  173. package/dist/esm/api/resources/account/client/requests/CampaignsAccountRequest.d.mts +18 -0
  174. package/dist/esm/api/resources/account/client/requests/CampaignsAccountRequest.mjs +2 -0
  175. package/dist/esm/api/resources/account/client/requests/CollabsAccountRequest.d.mts +12 -0
  176. package/dist/esm/api/resources/account/client/requests/CollabsAccountRequest.mjs +2 -0
  177. package/dist/esm/api/resources/account/client/requests/InsightsAccountRequest.d.mts +1 -1
  178. package/dist/esm/api/resources/account/client/requests/LandingPagesAccountRequest.d.mts +2 -1
  179. package/dist/esm/api/resources/account/client/requests/index.d.mts +7 -5
  180. package/dist/esm/api/resources/account/exports.d.mts +2 -2
  181. package/dist/esm/api/resources/account/exports.mjs +2 -2
  182. package/dist/esm/api/resources/account/index.d.mts +2 -2
  183. package/dist/esm/api/resources/account/index.mjs +2 -2
  184. package/dist/esm/api/resources/account/types/CampaignsAccountRequestDatePreset.d.mts +17 -0
  185. package/dist/esm/api/resources/account/types/CampaignsAccountRequestDatePreset.mjs +17 -0
  186. package/dist/esm/api/resources/account/types/CampaignsAccountRequestSortBy.d.mts +5 -0
  187. package/dist/esm/api/resources/account/types/CampaignsAccountRequestSortBy.mjs +5 -0
  188. package/dist/esm/api/resources/account/types/CampaignsAccountRequestType.d.mts +5 -0
  189. package/dist/esm/api/resources/account/types/CampaignsAccountRequestType.mjs +5 -0
  190. package/dist/esm/api/resources/account/types/CampaignsAccountResponse.d.mts +20 -0
  191. package/dist/esm/api/resources/account/types/CampaignsAccountResponse.mjs +2 -0
  192. package/dist/esm/api/resources/account/types/CollabsAccountResponse.d.mts +14 -0
  193. package/dist/esm/api/resources/account/types/CollabsAccountResponse.mjs +2 -0
  194. package/dist/esm/api/resources/account/types/GetAccountResponse.d.mts +3 -3
  195. package/dist/esm/api/resources/account/types/IndexAccountResponse.mjs +2 -2
  196. package/dist/esm/api/resources/account/types/IndexStatusAccountResponse.mjs +2 -2
  197. package/dist/esm/api/resources/account/types/InsightsAccountRequestType.mjs +4 -4
  198. package/dist/esm/api/resources/account/types/InsightsAccountResponse.d.mts +2 -12
  199. package/dist/esm/api/resources/account/types/LandingPagesAccountRequestShowInactive.mjs +2 -2
  200. package/dist/esm/api/resources/account/types/index.d.mts +12 -7
  201. package/dist/esm/api/resources/account/types/index.mjs +12 -7
  202. package/dist/esm/api/resources/index.d.mts +3 -3
  203. package/dist/esm/api/resources/index.mjs +3 -3
  204. package/dist/esm/api/types/Error_.mjs +11 -11
  205. package/dist/esm/api/types/SearchBrandsResponse.mjs +1 -1
  206. package/dist/esm/api/types/SearchCreatorsResponse.mjs +1 -1
  207. package/dist/esm/api/types/SearchMediaResponse.mjs +26 -26
  208. package/dist/esm/api/types/index.d.mts +7 -7
  209. package/dist/esm/api/types/index.mjs +7 -7
  210. package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
  211. package/dist/esm/auth/BearerAuthProvider.mjs +4 -4
  212. package/dist/esm/auth/index.d.mts +1 -1
  213. package/dist/esm/auth/index.mjs +1 -1
  214. package/dist/esm/core/auth/AuthProvider.d.mts +2 -2
  215. package/dist/esm/core/auth/AuthProvider.mjs +3 -3
  216. package/dist/esm/core/auth/BasicAuth.mjs +8 -8
  217. package/dist/esm/core/auth/BearerToken.mjs +1 -1
  218. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +2 -2
  219. package/dist/esm/core/auth/index.d.mts +5 -5
  220. package/dist/esm/core/auth/index.mjs +4 -4
  221. package/dist/esm/core/base64.mjs +4 -4
  222. package/dist/esm/core/exports.d.mts +1 -1
  223. package/dist/esm/core/exports.mjs +1 -1
  224. package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
  225. package/dist/esm/core/fetcher/BinaryResponse.d.mts +4 -4
  226. package/dist/esm/core/fetcher/BinaryResponse.mjs +1 -1
  227. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  228. package/dist/esm/core/fetcher/EndpointSupplier.mjs +1 -1
  229. package/dist/esm/core/fetcher/Fetcher.d.mts +11 -11
  230. package/dist/esm/core/fetcher/Fetcher.mjs +64 -70
  231. package/dist/esm/core/fetcher/Headers.mjs +10 -10
  232. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +2 -2
  233. package/dist/esm/core/fetcher/RawResponse.d.mts +1 -1
  234. package/dist/esm/core/fetcher/RawResponse.mjs +7 -7
  235. package/dist/esm/core/fetcher/Supplier.mjs +1 -1
  236. package/dist/esm/core/fetcher/createRequestUrl.mjs +2 -2
  237. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +13 -13
  238. package/dist/esm/core/fetcher/getRequestBody.d.mts +2 -2
  239. package/dist/esm/core/fetcher/getRequestBody.mjs +6 -6
  240. package/dist/esm/core/fetcher/getResponseBody.d.mts +2 -2
  241. package/dist/esm/core/fetcher/getResponseBody.mjs +13 -13
  242. package/dist/esm/core/fetcher/index.d.mts +13 -13
  243. package/dist/esm/core/fetcher/index.mjs +7 -7
  244. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +2 -2
  245. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +16 -16
  246. package/dist/esm/core/fetcher/makeRequest.mjs +4 -4
  247. package/dist/esm/core/fetcher/redactUrl.mjs +36 -36
  248. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -4
  249. package/dist/esm/core/fetcher/signals.mjs +2 -2
  250. package/dist/esm/core/index.d.mts +6 -6
  251. package/dist/esm/core/index.mjs +6 -6
  252. package/dist/esm/core/logging/exports.d.mts +1 -1
  253. package/dist/esm/core/logging/exports.mjs +1 -1
  254. package/dist/esm/core/logging/index.d.mts +1 -1
  255. package/dist/esm/core/logging/index.mjs +1 -1
  256. package/dist/esm/core/logging/logger.mjs +4 -4
  257. package/dist/esm/core/requestBody.mjs +1 -1
  258. package/dist/esm/core/runtime/index.d.mts +1 -1
  259. package/dist/esm/core/runtime/index.mjs +1 -1
  260. package/dist/esm/core/runtime/runtime.d.mts +1 -1
  261. package/dist/esm/core/runtime/runtime.mjs +35 -37
  262. package/dist/esm/core/url/QueryStringBuilder.d.mts +1 -1
  263. package/dist/esm/core/url/QueryStringBuilder.mjs +4 -4
  264. package/dist/esm/core/url/encodePathParam.mjs +8 -10
  265. package/dist/esm/core/url/index.d.mts +4 -4
  266. package/dist/esm/core/url/index.mjs +4 -4
  267. package/dist/esm/core/url/join.mjs +11 -11
  268. package/dist/esm/core/url/qs.d.mts +1 -1
  269. package/dist/esm/core/url/qs.mjs +14 -14
  270. package/dist/esm/environments.mjs +1 -1
  271. package/dist/esm/errors/SpyglassError.d.mts +1 -1
  272. package/dist/esm/errors/SpyglassError.mjs +4 -4
  273. package/dist/esm/errors/SpyglassTimeoutError.d.mts +1 -1
  274. package/dist/esm/errors/SpyglassTimeoutError.mjs +2 -2
  275. package/dist/esm/errors/handleNonStatusCodeError.d.mts +1 -1
  276. package/dist/esm/errors/handleNonStatusCodeError.mjs +6 -6
  277. package/dist/esm/errors/index.d.mts +2 -2
  278. package/dist/esm/errors/index.mjs +2 -2
  279. package/dist/esm/exports.d.mts +1 -1
  280. package/dist/esm/exports.mjs +1 -1
  281. package/dist/esm/index.d.mts +6 -6
  282. package/dist/esm/index.mjs +5 -5
  283. package/dist/esm/version.d.mts +1 -1
  284. package/dist/esm/version.mjs +1 -1
  285. package/package.json +91 -91
  286. package/reference.md +232 -91
package/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  ---
36
36
 
37
- **`@spyglasshq/sdk`** is the official TypeScript and Node.js client for the [Spyglass API](https://docs.spyglass.so). Resolve brands and creators, search across millions of Meta, Instagram, and TikTok creatives with natural-language briefs or structured filters, and extract hooks, personas, landing pages, and public comments.
37
+ **`@spyglasshq/sdk`** is the official TypeScript and Node.js client for the [Spyglass API](https://docs.spyglass.so). Resolve brands and creators, search across millions of Meta, Instagram, and TikTok creatives with natural-language briefs or structured filters, and extract hooks, personas, campaigns, collaborations, landing pages, and public comments.
38
38
 
39
39
  > Looking for Python? See [`spyglass-so/spyglass-python`](https://github.com/spyglass-so/spyglass-python) (`pip install spyglass-sdk`).
40
40
 
@@ -46,7 +46,7 @@
46
46
  - [Search Brands](#1-search-brands)
47
47
  - [Search Ad Creatives & Social Media](#2-search-ad-creatives--social-media)
48
48
  - [Discover Creators](#3-discover-creators)
49
- - [Creative Insights & Landing Pages](#4-creative-insights--landing-pages)
49
+ - [Creative Insights, Campaigns, Collabs & Landing Pages](#4-creative-insights-campaigns-collabs--landing-pages)
50
50
  - [Post Comments](#5-post-comments)
51
51
  - [Index a New Account](#6-index-a-new-account)
52
52
  - [Check Team Credit Usage](#7-check-team-credit-usage)
@@ -96,7 +96,7 @@ const brand = brands[0];
96
96
  if (brand) {
97
97
  // 2. Search the creatives that brand is running
98
98
  const { media } = await client.searchMedia({
99
- brandId: brand.id,
99
+ accountId: brand.id,
100
100
  query: "marathon running shoes comfort",
101
101
  limit: 10,
102
102
  });
@@ -120,7 +120,7 @@ if (brand) {
120
120
 
121
121
  ### 1. Search Brands
122
122
 
123
- Search advertisers by name (`names`), social handle (`igUsername`, `tiktokUsername`), known IDs (`brandIds`), or a natural-language brief (`query`). You can also combine `names` + `query` to rank a specific set of brands against a brief.
123
+ Search advertisers by name (`names`), social handle (`igUsername`, `tiktokUsername`), known IDs (`ids`), or a natural-language brief (`query`). You can also combine `names` + `query` to rank a specific set of brands against a brief.
124
124
 
125
125
  ```ts
126
126
  // Fuzzy name lookup
@@ -138,7 +138,7 @@ const byBrief = await client.searchBrands({
138
138
 
139
139
  ### 2. Search Ad Creatives & Social Media
140
140
 
141
- Pass `brandId` to inspect a specific brand or creator's creatives, or omit `brandId` and pass `query` to search across the entire Spyglass index. Combine semantic search with structured filters:
141
+ Pass `accountId` to inspect a specific brand or creator's creatives, or omit `accountId` and pass `query` to search across the entire Spyglass index. Combine semantic search with structured filters:
142
142
 
143
143
  ```ts
144
144
  // Optional: look up valid product taxonomy paths first (free call)
@@ -178,9 +178,9 @@ const { creators } = await client.searchCreators({
178
178
  });
179
179
  ```
180
180
 
181
- ### 4. Creative Insights & Landing Pages
181
+ ### 4. Creative Insights, Campaigns, Collabs & Landing Pages
182
182
 
183
- Pull clustered creative themes (`HOOK`, `USP`, `PERSONA`, `MEDIA_MIX`) and ranked destination landing pages for any account:
183
+ Pull clustered creative themes (`HOOK`, `USP`, `PERSONA`, `MEDIA_MIX`), campaigns or offers, creator collaborations, and ranked destination landing pages for any account:
184
184
 
185
185
  ```ts
186
186
  // Ranked hooks + weekly volume breakdown over the last 90 days
@@ -191,6 +191,20 @@ const insights = await client.account.insights({
191
191
  limit: 10,
192
192
  });
193
193
 
194
+ // Active campaigns or promotional offers
195
+ const { campaigns } = await client.account.campaigns({
196
+ id: brand.id,
197
+ type: "CAMPAIGN",
198
+ datePreset: "last-30-days",
199
+ limit: 10,
200
+ });
201
+
202
+ // Creators the account has collaborated with, ordered by media count
203
+ const { collabs } = await client.account.collabs({
204
+ id: brand.id,
205
+ limit: 20,
206
+ });
207
+
194
208
  // Top landing pages where the brand sends ad traffic
195
209
  const { landingPages } = await client.account.landingPages({
196
210
  id: brand.id,
@@ -249,14 +263,16 @@ console.log(`Remaining: ${usage.remainingCredits} / ${usage.planCredits}`);
249
263
 
250
264
  | SDK Method | HTTP Endpoint | Cost | Rate Limit |
251
265
  | --- | --- | --- | --- |
252
- | `client.searchBrands(req)` | `POST /brands` | $0.0020 / brand returned | 120 / min |
253
- | `client.searchCreators(req)` | `POST /creators` | $0.0020 / creator returned | 120 / min |
254
- | `client.searchMedia(req)` | `POST /media` | $0.0010 / creative returned | 120 / min |
266
+ | `client.searchBrands(req)` | `POST /brands` | $0.0010 / brand returned | 120 / min |
267
+ | `client.searchCreators(req)` | `POST /creators` | $0.0010 / creator returned | 120 / min |
268
+ | `client.searchMedia(req)` | `POST /media` | $0.0005 / creative returned | 120 / min |
255
269
  | `client.searchTaxonomies({ query })` | `GET /taxonomies` | Free | 120 / min |
256
- | `client.getComments(req)` | `POST /comments` | $0.0100 / live page fetched | 20 / min |
257
- | `client.account.get({ id })` | `GET /account/{id}` | $0.0020 / account returned | 120 / min |
258
- | `client.account.insights(req)` | `GET /account/{id}/insights` | $0.0010 / cluster returned | 120 / min |
259
- | `client.account.landingPages(req)` | `GET /account/{id}/landing-pages` | $0.0050 / landing page returned | 120 / min |
270
+ | `client.getComments(req)` | `POST /comments` | $0.0050 / live page fetched | 20 / min |
271
+ | `client.account.get({ id })` | `GET /account/{id}` | $0.0010 / account returned | 120 / min |
272
+ | `client.account.insights(req)` | `GET /account/{id}/insights` | $0.0005 / cluster returned | 120 / min |
273
+ | `client.account.campaigns(req)` | `GET /account/{id}/campaigns` | $0.0005 / campaign returned | 120 / min |
274
+ | `client.account.collabs(req)` | `GET /account/{id}/collabs` | $0.0005 / collab returned | 120 / min |
275
+ | `client.account.landingPages(req)` | `GET /account/{id}/landing-pages` | $0.0025 / landing page returned | 120 / min |
260
276
  | `client.account.index(req)` | `POST /account/index` | Free | 50 / min |
261
277
  | `client.account.indexStatus({ id })` | `GET /account/{id}/index-status` | Free | 300 / min |
262
278
  | `client.getCreditUsage()` | `GET /team/credit-usage` | Free | 120 / min |
@@ -1,7 +1,7 @@
1
- import { BearerAuthProvider } from './auth/BearerAuthProvider.js';
2
- import * as core from './core/index.js';
3
- import type * as environments from './environments.js';
4
- export type AuthOption = false | core.AuthProvider['getAuthRequest'] | core.AuthProvider | BearerAuthProvider.AuthOptions;
1
+ import { BearerAuthProvider } from "./auth/BearerAuthProvider.js";
2
+ import * as core from "./core/index.js";
3
+ import type * as environments from "./environments.js";
4
+ export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | BearerAuthProvider.AuthOptions;
5
5
  export type BaseClientOptions = {
6
6
  environment?: core.Supplier<environments.SpyglassEnvironment | string>;
7
7
  /** Specify a custom URL to connect the client to. */
@@ -41,12 +41,12 @@ const headers_js_1 = require("./core/headers.js");
41
41
  const core = __importStar(require("./core/index.js"));
42
42
  function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
- 'X-Fern-Language': 'JavaScript',
45
- 'X-Fern-SDK-Name': '@spyglasshq/sdk',
46
- 'X-Fern-SDK-Version': '0.1.9',
47
- 'User-Agent': '@spyglasshq/sdk/0.1.9',
48
- 'X-Fern-Runtime': core.RUNTIME.type,
49
- 'X-Fern-Runtime-Version': core.RUNTIME.version,
44
+ "X-Fern-Language": "JavaScript",
45
+ "X-Fern-SDK-Name": "@spyglasshq/sdk",
46
+ "X-Fern-SDK-Version": "0.1.11",
47
+ "User-Agent": "@spyglasshq/sdk/0.1.11",
48
+ "X-Fern-Runtime": core.RUNTIME.type,
49
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
51
51
  return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
52
52
  }
@@ -58,7 +58,7 @@ function normalizeClientOptionsWithAuth(options) {
58
58
  return normalized;
59
59
  }
60
60
  if (options.auth != null) {
61
- if (typeof options.auth === 'function') {
61
+ if (typeof options.auth === "function") {
62
62
  normalized.authProvider = { getAuthRequest: options.auth };
63
63
  return normalized;
64
64
  }
@@ -1,8 +1,8 @@
1
- import * as spyglass from './api/index.js';
2
- import { AccountClient } from './api/resources/account/client/Client.js';
3
- import type { BaseClientOptions, BaseRequestOptions } from './BaseClient.js';
4
- import { type NormalizedClientOptionsWithAuth } from './BaseClient.js';
5
- import * as core from './core/index.js';
1
+ import * as spyglass from "./api/index.js";
2
+ import { AccountClient } from "./api/resources/account/client/Client.js";
3
+ import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
4
+ import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
5
+ import * as core from "./core/index.js";
6
6
  export declare namespace Spyglass {
7
7
  type Options = BaseClientOptions;
8
8
  interface RequestOptions extends BaseRequestOptions {
@@ -26,7 +26,7 @@ export declare class Spyglass {
26
26
  * when nothing matches.
27
27
  * - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
28
28
  * match). Pass every name in one array.
29
- * - **ID** (`brandIds`). Looks up known ids. Missing ids are omitted and listed
29
+ * - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
30
30
  * in `unmatchedIds`. `limit` and `offset` are ignored.
31
31
  * - **Instagram** (`igUsername`). Case-insensitive contains match on the
32
32
  * handle. A leading `@` is ignored.
@@ -35,7 +35,7 @@ export declare class Spyglass {
35
35
  * If a request includes more than one of these fields, only the highest
36
36
  * priority field is used. The rest are ignored:
37
37
  *
38
- * 1. `brandIds`
38
+ * 1. `ids`
39
39
  * 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
40
40
  * 3. `names`
41
41
  * 4. `query`
@@ -47,7 +47,7 @@ export declare class Spyglass {
47
47
  * every mode except ID.
48
48
  *
49
49
  * Limited to 120 requests per minute per user.
50
- * Costs 2,000 microdollars ($0.0020) per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
50
+ * Costs $0.0010 per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
51
51
  * A `query` search runs a language model, so it bills a minimum of one
52
52
  * row even when nothing matches.
53
53
  *
@@ -86,7 +86,7 @@ export declare class Spyglass {
86
86
  * when nothing matches.
87
87
  * - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
88
88
  * match). Pass every name in one array.
89
- * - **ID** (`brandIds`). Looks up known ids. Missing ids are omitted and listed
89
+ * - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
90
90
  * in `unmatchedIds`. `limit` and `offset` are ignored.
91
91
  * - **Instagram** (`igUsername`). Case-insensitive contains match on the
92
92
  * handle. A leading `@` is ignored.
@@ -95,7 +95,7 @@ export declare class Spyglass {
95
95
  * If a request includes more than one of these fields, only the highest
96
96
  * priority field is used. The rest are ignored:
97
97
  *
98
- * 1. `brandIds`
98
+ * 1. `ids`
99
99
  * 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
100
100
  * 3. `names`
101
101
  * 4. `query`
@@ -107,7 +107,7 @@ export declare class Spyglass {
107
107
  * every mode except ID.
108
108
  *
109
109
  * Limited to 120 requests per minute per user.
110
- * Costs 2,000 microdollars ($0.0020) per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
110
+ * Costs $0.0010 per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
111
111
  * A `query` search runs a language model, so it bills a minimum of one
112
112
  * row even when nothing matches.
113
113
  *
@@ -168,7 +168,7 @@ export declare class Spyglass {
168
168
  * `query` is required.
169
169
  *
170
170
  * Limited to 120 requests per minute per user.
171
- * Costs 1,000 microdollars ($0.0010) per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
171
+ * Costs $0.0005 per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
172
172
  * The call bills a minimum of one row even when nothing matches. In that
173
173
  * case `count` is 0 but you are charged for one row.
174
174
  *
@@ -242,7 +242,7 @@ export declare class Spyglass {
242
242
  * are served from cache.
243
243
  *
244
244
  * Limited to 20 requests per minute per user.
245
- * Costs 10,000 microdollars ($0.0100) per successful page of comments returned, charged against your plan's monthly credits.
245
+ * Costs $0.0050 per successful page of comments returned, charged against your plan's monthly credits.
246
246
  * Each comment page fetched live (`limit`, default 1) is one billed
247
247
  * unit. Cached posts do not scrape and are not billed.
248
248
  *
@@ -74,7 +74,7 @@ class Spyglass {
74
74
  * when nothing matches.
75
75
  * - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
76
76
  * match). Pass every name in one array.
77
- * - **ID** (`brandIds`). Looks up known ids. Missing ids are omitted and listed
77
+ * - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
78
78
  * in `unmatchedIds`. `limit` and `offset` are ignored.
79
79
  * - **Instagram** (`igUsername`). Case-insensitive contains match on the
80
80
  * handle. A leading `@` is ignored.
@@ -83,7 +83,7 @@ class Spyglass {
83
83
  * If a request includes more than one of these fields, only the highest
84
84
  * priority field is used. The rest are ignored:
85
85
  *
86
- * 1. `brandIds`
86
+ * 1. `ids`
87
87
  * 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
88
88
  * 3. `names`
89
89
  * 4. `query`
@@ -95,7 +95,7 @@ class Spyglass {
95
95
  * every mode except ID.
96
96
  *
97
97
  * Limited to 120 requests per minute per user.
98
- * Costs 2,000 microdollars ($0.0020) per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
98
+ * Costs $0.0010 per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
99
99
  * A `query` search runs a language model, so it bills a minimum of one
100
100
  * row even when nothing matches.
101
101
  *
@@ -128,12 +128,12 @@ class Spyglass {
128
128
  const _authRequest = yield this._options.authProvider.getAuthRequest();
129
129
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
130
130
  const _response = yield core.fetcher({
131
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'brands'),
132
- method: 'POST',
131
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "brands"),
132
+ method: "POST",
133
133
  headers: _headers,
134
- contentType: 'application/json',
134
+ contentType: "application/json",
135
135
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
136
- requestType: 'json',
136
+ requestType: "json",
137
137
  body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
138
138
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
139
139
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
@@ -142,12 +142,9 @@ class Spyglass {
142
142
  logging: this._options.logging,
143
143
  });
144
144
  if (_response.ok) {
145
- return {
146
- data: _response.body,
147
- rawResponse: _response.rawResponse,
148
- };
145
+ return { data: _response.body, rawResponse: _response.rawResponse };
149
146
  }
150
- if (_response.error.reason === 'status-code') {
147
+ if (_response.error.reason === "status-code") {
151
148
  switch (_response.error.statusCode) {
152
149
  case 400:
153
150
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -173,7 +170,7 @@ class Spyglass {
173
170
  });
174
171
  }
175
172
  }
176
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'POST', '/brands');
173
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/brands");
177
174
  });
178
175
  }
179
176
  /**
@@ -189,7 +186,7 @@ class Spyglass {
189
186
  * when nothing matches.
190
187
  * - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
191
188
  * match). Pass every name in one array.
192
- * - **ID** (`brandIds`). Looks up known ids. Missing ids are omitted and listed
189
+ * - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
193
190
  * in `unmatchedIds`. `limit` and `offset` are ignored.
194
191
  * - **Instagram** (`igUsername`). Case-insensitive contains match on the
195
192
  * handle. A leading `@` is ignored.
@@ -198,7 +195,7 @@ class Spyglass {
198
195
  * If a request includes more than one of these fields, only the highest
199
196
  * priority field is used. The rest are ignored:
200
197
  *
201
- * 1. `brandIds`
198
+ * 1. `ids`
202
199
  * 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
203
200
  * 3. `names`
204
201
  * 4. `query`
@@ -210,7 +207,7 @@ class Spyglass {
210
207
  * every mode except ID.
211
208
  *
212
209
  * Limited to 120 requests per minute per user.
213
- * Costs 2,000 microdollars ($0.0020) per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
210
+ * Costs $0.0010 per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
214
211
  * A `query` search runs a language model, so it bills a minimum of one
215
212
  * row even when nothing matches.
216
213
  *
@@ -244,12 +241,12 @@ class Spyglass {
244
241
  const _authRequest = yield this._options.authProvider.getAuthRequest();
245
242
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
246
243
  const _response = yield core.fetcher({
247
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'creators'),
248
- method: 'POST',
244
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "creators"),
245
+ method: "POST",
249
246
  headers: _headers,
250
- contentType: 'application/json',
247
+ contentType: "application/json",
251
248
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
252
- requestType: 'json',
249
+ requestType: "json",
253
250
  body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
254
251
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
255
252
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
@@ -258,12 +255,9 @@ class Spyglass {
258
255
  logging: this._options.logging,
259
256
  });
260
257
  if (_response.ok) {
261
- return {
262
- data: _response.body,
263
- rawResponse: _response.rawResponse,
264
- };
258
+ return { data: _response.body, rawResponse: _response.rawResponse };
265
259
  }
266
- if (_response.error.reason === 'status-code') {
260
+ if (_response.error.reason === "status-code") {
267
261
  switch (_response.error.statusCode) {
268
262
  case 400:
269
263
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -289,7 +283,7 @@ class Spyglass {
289
283
  });
290
284
  }
291
285
  }
292
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'POST', '/creators');
286
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/creators");
293
287
  });
294
288
  }
295
289
  /**
@@ -332,8 +326,8 @@ class Spyglass {
332
326
  const _authRequest = yield this._options.authProvider.getAuthRequest();
333
327
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
334
328
  const _response = yield core.fetcher({
335
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'taxonomies'),
336
- method: 'GET',
329
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "taxonomies"),
330
+ method: "GET",
337
331
  headers: _headers,
338
332
  queryString: core.url
339
333
  .queryBuilder()
@@ -347,12 +341,9 @@ class Spyglass {
347
341
  logging: this._options.logging,
348
342
  });
349
343
  if (_response.ok) {
350
- return {
351
- data: _response.body,
352
- rawResponse: _response.rawResponse,
353
- };
344
+ return { data: _response.body, rawResponse: _response.rawResponse };
354
345
  }
355
- if (_response.error.reason === 'status-code') {
346
+ if (_response.error.reason === "status-code") {
356
347
  switch (_response.error.statusCode) {
357
348
  case 400:
358
349
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -376,7 +367,7 @@ class Spyglass {
376
367
  });
377
368
  }
378
369
  }
379
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'GET', '/taxonomies');
370
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/taxonomies");
380
371
  });
381
372
  }
382
373
  /**
@@ -385,7 +376,7 @@ class Spyglass {
385
376
  * `query` is required.
386
377
  *
387
378
  * Limited to 120 requests per minute per user.
388
- * Costs 1,000 microdollars ($0.0010) per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
379
+ * Costs $0.0005 per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
389
380
  * The call bills a minimum of one row even when nothing matches. In that
390
381
  * case `count` is 0 but you are charged for one row.
391
382
  *
@@ -419,12 +410,12 @@ class Spyglass {
419
410
  const _authRequest = yield this._options.authProvider.getAuthRequest();
420
411
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
421
412
  const _response = yield core.fetcher({
422
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'media'),
423
- method: 'POST',
413
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "media"),
414
+ method: "POST",
424
415
  headers: _headers,
425
- contentType: 'application/json',
416
+ contentType: "application/json",
426
417
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
427
- requestType: 'json',
418
+ requestType: "json",
428
419
  body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
429
420
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
430
421
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
@@ -433,12 +424,9 @@ class Spyglass {
433
424
  logging: this._options.logging,
434
425
  });
435
426
  if (_response.ok) {
436
- return {
437
- data: _response.body,
438
- rawResponse: _response.rawResponse,
439
- };
427
+ return { data: _response.body, rawResponse: _response.rawResponse };
440
428
  }
441
- if (_response.error.reason === 'status-code') {
429
+ if (_response.error.reason === "status-code") {
442
430
  switch (_response.error.statusCode) {
443
431
  case 400:
444
432
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -466,7 +454,7 @@ class Spyglass {
466
454
  });
467
455
  }
468
456
  }
469
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'POST', '/media');
457
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/media");
470
458
  });
471
459
  }
472
460
  /**
@@ -502,8 +490,8 @@ class Spyglass {
502
490
  const _authRequest = yield this._options.authProvider.getAuthRequest();
503
491
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
504
492
  const _response = yield core.fetcher({
505
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'team/credit-usage'),
506
- method: 'GET',
493
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "team/credit-usage"),
494
+ method: "GET",
507
495
  headers: _headers,
508
496
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
509
497
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -513,12 +501,9 @@ class Spyglass {
513
501
  logging: this._options.logging,
514
502
  });
515
503
  if (_response.ok) {
516
- return {
517
- data: _response.body,
518
- rawResponse: _response.rawResponse,
519
- };
504
+ return { data: _response.body, rawResponse: _response.rawResponse };
520
505
  }
521
- if (_response.error.reason === 'status-code') {
506
+ if (_response.error.reason === "status-code") {
522
507
  switch (_response.error.statusCode) {
523
508
  case 400:
524
509
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -542,7 +527,7 @@ class Spyglass {
542
527
  });
543
528
  }
544
529
  }
545
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'GET', '/team/credit-usage');
530
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/team/credit-usage");
546
531
  });
547
532
  }
548
533
  /**
@@ -566,7 +551,7 @@ class Spyglass {
566
551
  * are served from cache.
567
552
  *
568
553
  * Limited to 20 requests per minute per user.
569
- * Costs 10,000 microdollars ($0.0100) per successful page of comments returned, charged against your plan's monthly credits.
554
+ * Costs $0.0050 per successful page of comments returned, charged against your plan's monthly credits.
570
555
  * Each comment page fetched live (`limit`, default 1) is one billed
571
556
  * unit. Cached posts do not scrape and are not billed.
572
557
  *
@@ -600,12 +585,12 @@ class Spyglass {
600
585
  const _authRequest = yield this._options.authProvider.getAuthRequest();
601
586
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
602
587
  const _response = yield core.fetcher({
603
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, 'comments'),
604
- method: 'POST',
588
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "comments"),
589
+ method: "POST",
605
590
  headers: _headers,
606
- contentType: 'application/json',
591
+ contentType: "application/json",
607
592
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
608
- requestType: 'json',
593
+ requestType: "json",
609
594
  body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
610
595
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
611
596
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
@@ -614,12 +599,9 @@ class Spyglass {
614
599
  logging: this._options.logging,
615
600
  });
616
601
  if (_response.ok) {
617
- return {
618
- data: _response.body,
619
- rawResponse: _response.rawResponse,
620
- };
602
+ return { data: _response.body, rawResponse: _response.rawResponse };
621
603
  }
622
- if (_response.error.reason === 'status-code') {
604
+ if (_response.error.reason === "status-code") {
623
605
  switch (_response.error.statusCode) {
624
606
  case 400:
625
607
  throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
@@ -645,7 +627,7 @@ class Spyglass {
645
627
  });
646
628
  }
647
629
  }
648
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, 'POST', '/comments');
630
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/comments");
649
631
  });
650
632
  }
651
633
  /**
@@ -1 +1 @@
1
- export * from './requests/index.js';
1
+ export * from "./requests/index.js";
@@ -6,7 +6,7 @@
6
6
  * }
7
7
  */
8
8
  export interface SearchBrandsRequest {
9
- brandIds?: SearchBrandsRequest.BrandIds.Item[];
9
+ ids?: SearchBrandsRequest.Ids.Item[];
10
10
  names?: string[];
11
11
  igUsername?: string;
12
12
  tiktokUsername?: string;
@@ -20,10 +20,10 @@ export interface SearchBrandsRequest {
20
20
  taxonomy?: string[];
21
21
  }
22
22
  export declare namespace SearchBrandsRequest {
23
- type BrandIds = BrandIds.Item[];
24
- namespace BrandIds {
23
+ type Ids = Ids.Item[];
24
+ namespace Ids {
25
25
  /**
26
- * Brand id given as a platform string or uuid
26
+ * Account id given as a platform string or uuid
27
27
  */
28
28
  type Item = string | number;
29
29
  }
@@ -5,11 +5,11 @@ exports.SearchBrandsRequest = void 0;
5
5
  var SearchBrandsRequest;
6
6
  (function (SearchBrandsRequest) {
7
7
  SearchBrandsRequest.SortBy = {
8
- Name: 'NAME',
9
- MostFollowers: 'MOST_FOLLOWERS',
10
- LeastFollowers: 'LEAST_FOLLOWERS',
11
- MostViews: 'MOST_VIEWS',
12
- HighestEngagement: 'HIGHEST_ENGAGEMENT',
13
- MostActiveAds: 'MOST_ACTIVE_ADS',
8
+ Name: "NAME",
9
+ MostFollowers: "MOST_FOLLOWERS",
10
+ LeastFollowers: "LEAST_FOLLOWERS",
11
+ MostViews: "MOST_VIEWS",
12
+ HighestEngagement: "HIGHEST_ENGAGEMENT",
13
+ MostActiveAds: "MOST_ACTIVE_ADS",
14
14
  };
15
15
  })(SearchBrandsRequest || (exports.SearchBrandsRequest = SearchBrandsRequest = {}));
@@ -7,7 +7,7 @@
7
7
  * }
8
8
  */
9
9
  export interface SearchCreatorsRequest {
10
- brandIds?: SearchCreatorsRequest.BrandIds.Item[];
10
+ ids?: SearchCreatorsRequest.Ids.Item[];
11
11
  names?: string[];
12
12
  igUsername?: string;
13
13
  tiktokUsername?: string;
@@ -24,10 +24,10 @@ export interface SearchCreatorsRequest {
24
24
  language?: SearchCreatorsRequest.Language;
25
25
  }
26
26
  export declare namespace SearchCreatorsRequest {
27
- type BrandIds = BrandIds.Item[];
28
- namespace BrandIds {
27
+ type Ids = Ids.Item[];
28
+ namespace Ids {
29
29
  /**
30
- * Brand id given as a platform string or uuid
30
+ * Account id given as a platform string or uuid
31
31
  */
32
32
  type Item = string | number;
33
33
  }