x-twitter-scraper 0.12.3 → 0.13.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.
Files changed (473) hide show
  1. package/CHANGELOG.md +73 -2
  2. package/README.md +66 -51
  3. package/client.d.mts +18 -15
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +18 -15
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +4 -4
  10. package/client.mjs.map +1 -1
  11. package/core/streaming.d.mts +33 -0
  12. package/core/streaming.d.mts.map +1 -0
  13. package/core/streaming.d.ts +33 -0
  14. package/core/streaming.d.ts.map +1 -0
  15. package/core/streaming.js +270 -0
  16. package/core/streaming.js.map +1 -0
  17. package/core/streaming.mjs +265 -0
  18. package/core/streaming.mjs.map +1 -0
  19. package/internal/decoders/line.d.mts +17 -0
  20. package/internal/decoders/line.d.mts.map +1 -0
  21. package/internal/decoders/line.d.ts +17 -0
  22. package/internal/decoders/line.d.ts.map +1 -0
  23. package/internal/decoders/line.js +116 -0
  24. package/internal/decoders/line.js.map +1 -0
  25. package/internal/decoders/line.mjs +111 -0
  26. package/internal/decoders/line.mjs.map +1 -0
  27. package/internal/parse.d.mts.map +1 -1
  28. package/internal/parse.d.ts.map +1 -1
  29. package/internal/parse.js +7 -0
  30. package/internal/parse.js.map +1 -1
  31. package/internal/parse.mjs +7 -0
  32. package/internal/parse.mjs.map +1 -1
  33. package/internal/tslib.js +18 -18
  34. package/package.json +23 -5
  35. package/resources/account.d.mts +35 -12
  36. package/resources/account.d.mts.map +1 -1
  37. package/resources/account.d.ts +35 -12
  38. package/resources/account.d.ts.map +1 -1
  39. package/resources/account.js +4 -3
  40. package/resources/account.js.map +1 -1
  41. package/resources/account.mjs +4 -3
  42. package/resources/account.mjs.map +1 -1
  43. package/resources/compose.d.mts +77 -21
  44. package/resources/compose.d.mts.map +1 -1
  45. package/resources/compose.d.ts +77 -21
  46. package/resources/compose.d.ts.map +1 -1
  47. package/resources/compose.js +3 -4
  48. package/resources/compose.js.map +1 -1
  49. package/resources/compose.mjs +3 -4
  50. package/resources/compose.mjs.map +1 -1
  51. package/resources/credits.d.mts +18 -10
  52. package/resources/credits.d.mts.map +1 -1
  53. package/resources/credits.d.ts +18 -10
  54. package/resources/credits.d.ts.map +1 -1
  55. package/resources/credits.js +5 -4
  56. package/resources/credits.js.map +1 -1
  57. package/resources/credits.mjs +5 -4
  58. package/resources/credits.mjs.map +1 -1
  59. package/resources/drafts.d.mts +13 -17
  60. package/resources/drafts.d.mts.map +1 -1
  61. package/resources/drafts.d.ts +13 -17
  62. package/resources/drafts.d.ts.map +1 -1
  63. package/resources/drafts.js +4 -4
  64. package/resources/drafts.mjs +4 -4
  65. package/resources/draws.d.mts +84 -28
  66. package/resources/draws.d.mts.map +1 -1
  67. package/resources/draws.d.ts +84 -28
  68. package/resources/draws.d.ts.map +1 -1
  69. package/resources/draws.js +24 -9
  70. package/resources/draws.js.map +1 -1
  71. package/resources/draws.mjs +24 -9
  72. package/resources/draws.mjs.map +1 -1
  73. package/resources/events.d.mts +2564 -21
  74. package/resources/events.d.mts.map +1 -1
  75. package/resources/events.d.ts +2564 -21
  76. package/resources/events.d.ts.map +1 -1
  77. package/resources/events.js +34 -2
  78. package/resources/events.js.map +1 -1
  79. package/resources/events.mjs +34 -2
  80. package/resources/events.mjs.map +1 -1
  81. package/resources/extractions.d.mts +410 -128
  82. package/resources/extractions.d.mts.map +1 -1
  83. package/resources/extractions.d.ts +410 -128
  84. package/resources/extractions.d.ts.map +1 -1
  85. package/resources/extractions.js +74 -12
  86. package/resources/extractions.js.map +1 -1
  87. package/resources/extractions.mjs +74 -12
  88. package/resources/extractions.mjs.map +1 -1
  89. package/resources/guest-wallets.d.mts +6 -5
  90. package/resources/guest-wallets.d.mts.map +1 -1
  91. package/resources/guest-wallets.d.ts +6 -5
  92. package/resources/guest-wallets.d.ts.map +1 -1
  93. package/resources/guest-wallets.js +2 -1
  94. package/resources/guest-wallets.js.map +1 -1
  95. package/resources/guest-wallets.mjs +2 -1
  96. package/resources/guest-wallets.mjs.map +1 -1
  97. package/resources/index.d.mts +6 -6
  98. package/resources/index.d.mts.map +1 -1
  99. package/resources/index.d.ts +6 -6
  100. package/resources/index.d.ts.map +1 -1
  101. package/resources/index.js.map +1 -1
  102. package/resources/index.mjs +1 -1
  103. package/resources/index.mjs.map +1 -1
  104. package/resources/monitors/index.d.mts +2 -2
  105. package/resources/monitors/index.d.mts.map +1 -1
  106. package/resources/monitors/index.d.ts +2 -2
  107. package/resources/monitors/index.d.ts.map +1 -1
  108. package/resources/monitors/index.js.map +1 -1
  109. package/resources/monitors/index.mjs.map +1 -1
  110. package/resources/monitors/keywords.d.mts +66 -14
  111. package/resources/monitors/keywords.d.mts.map +1 -1
  112. package/resources/monitors/keywords.d.ts +66 -14
  113. package/resources/monitors/keywords.d.ts.map +1 -1
  114. package/resources/monitors/keywords.js +16 -10
  115. package/resources/monitors/keywords.js.map +1 -1
  116. package/resources/monitors/keywords.mjs +16 -10
  117. package/resources/monitors/keywords.mjs.map +1 -1
  118. package/resources/monitors/monitors.d.mts +53 -16
  119. package/resources/monitors/monitors.d.mts.map +1 -1
  120. package/resources/monitors/monitors.d.ts +53 -16
  121. package/resources/monitors/monitors.d.ts.map +1 -1
  122. package/resources/monitors/monitors.js +12 -10
  123. package/resources/monitors/monitors.js.map +1 -1
  124. package/resources/monitors/monitors.mjs +12 -10
  125. package/resources/monitors/monitors.mjs.map +1 -1
  126. package/resources/radar.d.mts +32 -36
  127. package/resources/radar.d.mts.map +1 -1
  128. package/resources/radar.d.ts +32 -36
  129. package/resources/radar.d.ts.map +1 -1
  130. package/resources/radar.js +1 -1
  131. package/resources/radar.mjs +1 -1
  132. package/resources/shared.d.mts +1726 -233
  133. package/resources/shared.d.mts.map +1 -1
  134. package/resources/shared.d.ts +1726 -233
  135. package/resources/shared.d.ts.map +1 -1
  136. package/resources/styles.d.mts +34 -23
  137. package/resources/styles.d.mts.map +1 -1
  138. package/resources/styles.d.ts +34 -23
  139. package/resources/styles.d.ts.map +1 -1
  140. package/resources/styles.js +11 -13
  141. package/resources/styles.js.map +1 -1
  142. package/resources/styles.mjs +11 -13
  143. package/resources/styles.mjs.map +1 -1
  144. package/resources/subscribe.d.mts +1 -1
  145. package/resources/subscribe.d.ts +1 -1
  146. package/resources/subscribe.js +1 -1
  147. package/resources/subscribe.mjs +1 -1
  148. package/resources/support/index.d.mts +1 -1
  149. package/resources/support/index.d.mts.map +1 -1
  150. package/resources/support/index.d.ts +1 -1
  151. package/resources/support/index.d.ts.map +1 -1
  152. package/resources/support/index.js.map +1 -1
  153. package/resources/support/index.mjs.map +1 -1
  154. package/resources/support/support.d.mts +2 -2
  155. package/resources/support/support.d.mts.map +1 -1
  156. package/resources/support/support.d.ts +2 -2
  157. package/resources/support/support.d.ts.map +1 -1
  158. package/resources/support/support.js.map +1 -1
  159. package/resources/support/support.mjs.map +1 -1
  160. package/resources/support/tickets.d.mts +30 -10
  161. package/resources/support/tickets.d.mts.map +1 -1
  162. package/resources/support/tickets.d.ts +30 -10
  163. package/resources/support/tickets.d.ts.map +1 -1
  164. package/resources/support/tickets.js +7 -7
  165. package/resources/support/tickets.js.map +1 -1
  166. package/resources/support/tickets.mjs +7 -7
  167. package/resources/support/tickets.mjs.map +1 -1
  168. package/resources/trends.d.mts +21 -5
  169. package/resources/trends.d.mts.map +1 -1
  170. package/resources/trends.d.ts +21 -5
  171. package/resources/trends.d.ts.map +1 -1
  172. package/resources/trends.js +2 -1
  173. package/resources/trends.js.map +1 -1
  174. package/resources/trends.mjs +2 -1
  175. package/resources/trends.mjs.map +1 -1
  176. package/resources/webhooks.d.mts +80 -14
  177. package/resources/webhooks.d.mts.map +1 -1
  178. package/resources/webhooks.d.ts +80 -14
  179. package/resources/webhooks.d.ts.map +1 -1
  180. package/resources/webhooks.js +30 -11
  181. package/resources/webhooks.js.map +1 -1
  182. package/resources/webhooks.mjs +30 -11
  183. package/resources/webhooks.mjs.map +1 -1
  184. package/resources/x/account-connection-attempts.d.mts +1 -1
  185. package/resources/x/account-connection-attempts.d.ts +1 -1
  186. package/resources/x/account-connection-attempts.js +1 -1
  187. package/resources/x/account-connection-attempts.mjs +1 -1
  188. package/resources/x/account-connection-challenges.d.mts +30 -11
  189. package/resources/x/account-connection-challenges.d.mts.map +1 -1
  190. package/resources/x/account-connection-challenges.d.ts +30 -11
  191. package/resources/x/account-connection-challenges.d.ts.map +1 -1
  192. package/resources/x/account-connection-challenges.js +5 -4
  193. package/resources/x/account-connection-challenges.js.map +1 -1
  194. package/resources/x/account-connection-challenges.mjs +5 -4
  195. package/resources/x/account-connection-challenges.mjs.map +1 -1
  196. package/resources/x/accounts.d.mts +38 -10
  197. package/resources/x/accounts.d.mts.map +1 -1
  198. package/resources/x/accounts.d.ts +38 -10
  199. package/resources/x/accounts.d.ts.map +1 -1
  200. package/resources/x/accounts.js +8 -7
  201. package/resources/x/accounts.js.map +1 -1
  202. package/resources/x/accounts.mjs +8 -7
  203. package/resources/x/accounts.mjs.map +1 -1
  204. package/resources/x/analysis.d.mts +3274 -0
  205. package/resources/x/analysis.d.mts.map +1 -0
  206. package/resources/x/analysis.d.ts +3274 -0
  207. package/resources/x/analysis.d.ts.map +1 -0
  208. package/resources/x/analysis.js +132 -0
  209. package/resources/x/analysis.js.map +1 -0
  210. package/resources/x/analysis.mjs +128 -0
  211. package/resources/x/analysis.mjs.map +1 -0
  212. package/resources/x/bookmarks.d.mts +84 -9
  213. package/resources/x/bookmarks.d.mts.map +1 -1
  214. package/resources/x/bookmarks.d.ts +84 -9
  215. package/resources/x/bookmarks.d.ts.map +1 -1
  216. package/resources/x/bookmarks.js +6 -4
  217. package/resources/x/bookmarks.js.map +1 -1
  218. package/resources/x/bookmarks.mjs +6 -4
  219. package/resources/x/bookmarks.mjs.map +1 -1
  220. package/resources/x/broadcasts.d.mts +176 -0
  221. package/resources/x/broadcasts.d.mts.map +1 -0
  222. package/resources/x/broadcasts.d.ts +176 -0
  223. package/resources/x/broadcasts.d.ts.map +1 -0
  224. package/resources/x/broadcasts.js +29 -0
  225. package/resources/x/broadcasts.js.map +1 -0
  226. package/resources/x/broadcasts.mjs +25 -0
  227. package/resources/x/broadcasts.mjs.map +1 -0
  228. package/resources/x/communities/communities.d.mts +612 -128
  229. package/resources/x/communities/communities.d.mts.map +1 -1
  230. package/resources/x/communities/communities.d.ts +612 -128
  231. package/resources/x/communities/communities.d.ts.map +1 -1
  232. package/resources/x/communities/communities.js +96 -17
  233. package/resources/x/communities/communities.js.map +1 -1
  234. package/resources/x/communities/communities.mjs +96 -17
  235. package/resources/x/communities/communities.mjs.map +1 -1
  236. package/resources/x/communities/index.d.mts +2 -1
  237. package/resources/x/communities/index.d.mts.map +1 -1
  238. package/resources/x/communities/index.d.ts +2 -1
  239. package/resources/x/communities/index.d.ts.map +1 -1
  240. package/resources/x/communities/index.js +3 -1
  241. package/resources/x/communities/index.js.map +1 -1
  242. package/resources/x/communities/index.mjs +1 -0
  243. package/resources/x/communities/index.mjs.map +1 -1
  244. package/resources/x/communities/join.d.mts +46 -25
  245. package/resources/x/communities/join.d.mts.map +1 -1
  246. package/resources/x/communities/join.d.ts +46 -25
  247. package/resources/x/communities/join.d.ts.map +1 -1
  248. package/resources/x/communities/join.js +10 -7
  249. package/resources/x/communities/join.js.map +1 -1
  250. package/resources/x/communities/join.mjs +10 -7
  251. package/resources/x/communities/join.mjs.map +1 -1
  252. package/resources/x/communities/media.d.mts +197 -0
  253. package/resources/x/communities/media.d.mts.map +1 -0
  254. package/resources/x/communities/media.d.ts +197 -0
  255. package/resources/x/communities/media.d.ts.map +1 -0
  256. package/resources/x/communities/media.js +29 -0
  257. package/resources/x/communities/media.js.map +1 -0
  258. package/resources/x/communities/media.mjs +25 -0
  259. package/resources/x/communities/media.mjs.map +1 -0
  260. package/resources/x/communities/tweets.d.mts +350 -20
  261. package/resources/x/communities/tweets.d.mts.map +1 -1
  262. package/resources/x/communities/tweets.d.ts +350 -20
  263. package/resources/x/communities/tweets.d.ts.map +1 -1
  264. package/resources/x/communities/tweets.js +8 -7
  265. package/resources/x/communities/tweets.js.map +1 -1
  266. package/resources/x/communities/tweets.mjs +8 -7
  267. package/resources/x/communities/tweets.mjs.map +1 -1
  268. package/resources/x/dm.d.mts +245 -13
  269. package/resources/x/dm.d.mts.map +1 -1
  270. package/resources/x/dm.d.ts +245 -13
  271. package/resources/x/dm.d.ts.map +1 -1
  272. package/resources/x/dm.js +29 -2
  273. package/resources/x/dm.js.map +1 -1
  274. package/resources/x/dm.mjs +29 -2
  275. package/resources/x/dm.mjs.map +1 -1
  276. package/resources/x/followers.d.mts +31 -3
  277. package/resources/x/followers.d.mts.map +1 -1
  278. package/resources/x/followers.d.ts +31 -3
  279. package/resources/x/followers.d.ts.map +1 -1
  280. package/resources/x/followers.js +2 -1
  281. package/resources/x/followers.js.map +1 -1
  282. package/resources/x/followers.mjs +2 -1
  283. package/resources/x/followers.mjs.map +1 -1
  284. package/resources/x/index.d.mts +12 -8
  285. package/resources/x/index.d.mts.map +1 -1
  286. package/resources/x/index.d.ts +12 -8
  287. package/resources/x/index.d.ts.map +1 -1
  288. package/resources/x/index.js +9 -1
  289. package/resources/x/index.js.map +1 -1
  290. package/resources/x/index.mjs +5 -1
  291. package/resources/x/index.mjs.map +1 -1
  292. package/resources/x/jobs.d.mts +506 -0
  293. package/resources/x/jobs.d.mts.map +1 -0
  294. package/resources/x/jobs.d.ts +506 -0
  295. package/resources/x/jobs.d.ts.map +1 -0
  296. package/resources/x/jobs.js +60 -0
  297. package/resources/x/jobs.js.map +1 -0
  298. package/resources/x/jobs.mjs +56 -0
  299. package/resources/x/jobs.mjs.map +1 -0
  300. package/resources/x/lists.d.mts +1058 -27
  301. package/resources/x/lists.d.mts.map +1 -1
  302. package/resources/x/lists.d.ts +1058 -27
  303. package/resources/x/lists.d.ts.map +1 -1
  304. package/resources/x/lists.js +39 -9
  305. package/resources/x/lists.js.map +1 -1
  306. package/resources/x/lists.mjs +39 -9
  307. package/resources/x/lists.mjs.map +1 -1
  308. package/resources/x/media.d.mts +24 -13
  309. package/resources/x/media.d.mts.map +1 -1
  310. package/resources/x/media.d.ts +24 -13
  311. package/resources/x/media.d.ts.map +1 -1
  312. package/resources/x/media.js +2 -2
  313. package/resources/x/media.mjs +2 -2
  314. package/resources/x/profile.d.mts +60 -33
  315. package/resources/x/profile.d.mts.map +1 -1
  316. package/resources/x/profile.d.ts +60 -33
  317. package/resources/x/profile.d.ts.map +1 -1
  318. package/resources/x/profile.js +3 -3
  319. package/resources/x/profile.mjs +3 -3
  320. package/resources/x/spaces.d.mts +857 -0
  321. package/resources/x/spaces.d.mts.map +1 -0
  322. package/resources/x/spaces.d.ts +857 -0
  323. package/resources/x/spaces.d.ts.map +1 -0
  324. package/resources/x/spaces.js +58 -0
  325. package/resources/x/spaces.js.map +1 -0
  326. package/resources/x/spaces.mjs +54 -0
  327. package/resources/x/spaces.mjs.map +1 -0
  328. package/resources/x/tweets/index.d.mts +1 -1
  329. package/resources/x/tweets/index.d.mts.map +1 -1
  330. package/resources/x/tweets/index.d.ts +1 -1
  331. package/resources/x/tweets/index.d.ts.map +1 -1
  332. package/resources/x/tweets/index.js.map +1 -1
  333. package/resources/x/tweets/index.mjs.map +1 -1
  334. package/resources/x/tweets/like.d.mts +38 -20
  335. package/resources/x/tweets/like.d.mts.map +1 -1
  336. package/resources/x/tweets/like.d.ts +38 -20
  337. package/resources/x/tweets/like.d.ts.map +1 -1
  338. package/resources/x/tweets/like.js +2 -2
  339. package/resources/x/tweets/like.mjs +2 -2
  340. package/resources/x/tweets/retweet.d.mts +38 -20
  341. package/resources/x/tweets/retweet.d.mts.map +1 -1
  342. package/resources/x/tweets/retweet.d.ts +38 -20
  343. package/resources/x/tweets/retweet.d.ts.map +1 -1
  344. package/resources/x/tweets/retweet.js +2 -2
  345. package/resources/x/tweets/retweet.mjs +2 -2
  346. package/resources/x/tweets/tweets.d.mts +2639 -326
  347. package/resources/x/tweets/tweets.d.mts.map +1 -1
  348. package/resources/x/tweets/tweets.d.ts +2639 -326
  349. package/resources/x/tweets/tweets.d.ts.map +1 -1
  350. package/resources/x/tweets/tweets.js +147 -21
  351. package/resources/x/tweets/tweets.js.map +1 -1
  352. package/resources/x/tweets/tweets.mjs +147 -21
  353. package/resources/x/tweets/tweets.mjs.map +1 -1
  354. package/resources/x/users/follow.d.mts +38 -20
  355. package/resources/x/users/follow.d.mts.map +1 -1
  356. package/resources/x/users/follow.d.ts +38 -20
  357. package/resources/x/users/follow.d.ts.map +1 -1
  358. package/resources/x/users/follow.js +2 -2
  359. package/resources/x/users/follow.mjs +2 -2
  360. package/resources/x/users/index.d.mts +1 -1
  361. package/resources/x/users/index.d.mts.map +1 -1
  362. package/resources/x/users/index.d.ts +1 -1
  363. package/resources/x/users/index.d.ts.map +1 -1
  364. package/resources/x/users/index.js.map +1 -1
  365. package/resources/x/users/index.mjs.map +1 -1
  366. package/resources/x/users/users.d.mts +3068 -457
  367. package/resources/x/users/users.d.mts.map +1 -1
  368. package/resources/x/users/users.d.ts +3068 -457
  369. package/resources/x/users/users.d.ts.map +1 -1
  370. package/resources/x/users/users.js +205 -22
  371. package/resources/x/users/users.js.map +1 -1
  372. package/resources/x/users/users.mjs +205 -22
  373. package/resources/x/users/users.mjs.map +1 -1
  374. package/resources/x/write-actions.d.mts +13 -6
  375. package/resources/x/write-actions.d.mts.map +1 -1
  376. package/resources/x/write-actions.d.ts +13 -6
  377. package/resources/x/write-actions.d.ts.map +1 -1
  378. package/resources/x/write-actions.js +1 -1
  379. package/resources/x/write-actions.mjs +1 -1
  380. package/resources/x/x.d.mts +864 -27
  381. package/resources/x/x.d.mts.map +1 -1
  382. package/resources/x/x.d.ts +864 -27
  383. package/resources/x/x.d.ts.map +1 -1
  384. package/resources/x/x.js +78 -5
  385. package/resources/x/x.js.map +1 -1
  386. package/resources/x/x.mjs +80 -7
  387. package/resources/x/x.mjs.map +1 -1
  388. package/skills/x-twitter-scraper/SKILL.md +97 -350
  389. package/skills/x-twitter-scraper/metadata.json +3 -9
  390. package/skills/x-twitter-scraper/references/draws.md +24 -24
  391. package/skills/x-twitter-scraper/references/extractions.md +71 -62
  392. package/skills/x-twitter-scraper/references/mcp-setup.md +36 -39
  393. package/skills/x-twitter-scraper/references/mcp-tools.md +105 -166
  394. package/skills/x-twitter-scraper/references/python-examples.md +5 -5
  395. package/skills/x-twitter-scraper/references/security.md +8 -8
  396. package/skills/x-twitter-scraper/references/types-mcp-output-schemas.md +4 -4
  397. package/skills/x-twitter-scraper/references/types.md +0 -1
  398. package/skills/x-twitter-scraper/references/usage.md +5 -5
  399. package/skills/x-twitter-scraper/references/webhooks.md +28 -31
  400. package/skills/x-twitter-scraper/references/workflows.md +70 -71
  401. package/skills/x-twitter-scraper/skill-card.md +13 -14
  402. package/skills/x-twitter-scraper/skillspector-report.md +8 -5
  403. package/skills/xquik-account-automation/LICENSE +21 -0
  404. package/skills/xquik-account-automation/SKILL.md +91 -0
  405. package/skills/xquik-social-research/SKILL.md +49 -56
  406. package/src/client.ts +47 -4
  407. package/src/core/streaming.ts +328 -0
  408. package/src/internal/decoders/line.ts +140 -0
  409. package/src/internal/parse.ts +9 -0
  410. package/src/resources/account.ts +41 -12
  411. package/src/resources/compose.ts +77 -21
  412. package/src/resources/credits.ts +19 -10
  413. package/src/resources/drafts.ts +13 -22
  414. package/src/resources/draws.ts +94 -36
  415. package/src/resources/events.ts +3225 -68
  416. package/src/resources/extractions.ts +512 -125
  417. package/src/resources/guest-wallets.ts +6 -5
  418. package/src/resources/index.ts +24 -1
  419. package/src/resources/monitors/index.ts +2 -0
  420. package/src/resources/monitors/keywords.ts +82 -14
  421. package/src/resources/monitors/monitors.ts +66 -14
  422. package/src/resources/radar.ts +32 -36
  423. package/src/resources/shared.ts +2227 -351
  424. package/src/resources/styles.ts +43 -27
  425. package/src/resources/subscribe.ts +1 -1
  426. package/src/resources/support/index.ts +1 -0
  427. package/src/resources/support/support.ts +2 -0
  428. package/src/resources/support/tickets.ts +38 -10
  429. package/src/resources/trends.ts +23 -5
  430. package/src/resources/webhooks.ts +109 -15
  431. package/src/resources/x/account-connection-attempts.ts +1 -1
  432. package/src/resources/x/account-connection-challenges.ts +39 -11
  433. package/src/resources/x/accounts.ts +46 -10
  434. package/src/resources/x/analysis.ts +3947 -0
  435. package/src/resources/x/bookmarks.ts +103 -9
  436. package/src/resources/x/broadcasts.ts +225 -0
  437. package/src/resources/x/communities/communities.ts +743 -141
  438. package/src/resources/x/communities/index.ts +9 -0
  439. package/src/resources/x/communities/join.ts +46 -23
  440. package/src/resources/x/communities/media.ts +251 -0
  441. package/src/resources/x/communities/tweets.ts +427 -20
  442. package/src/resources/x/dm.ts +334 -11
  443. package/src/resources/x/followers.ts +35 -3
  444. package/src/resources/x/index.ts +106 -1
  445. package/src/resources/x/jobs.ts +627 -0
  446. package/src/resources/x/lists.ts +1307 -28
  447. package/src/resources/x/media.ts +24 -12
  448. package/src/resources/x/profile.ts +60 -30
  449. package/src/resources/x/spaces.ts +1076 -0
  450. package/src/resources/x/tweets/index.ts +18 -0
  451. package/src/resources/x/tweets/like.ts +38 -18
  452. package/src/resources/x/tweets/retweet.ts +38 -18
  453. package/src/resources/x/tweets/tweets.ts +3695 -843
  454. package/src/resources/x/users/follow.ts +38 -18
  455. package/src/resources/x/users/index.ts +22 -0
  456. package/src/resources/x/users/users.ts +3687 -465
  457. package/src/resources/x/write-actions.ts +13 -5
  458. package/src/resources/x/x.ts +1227 -15
  459. package/src/streaming.ts +6 -0
  460. package/src/version.ts +1 -1
  461. package/streaming.d.mts +3 -0
  462. package/streaming.d.mts.map +1 -0
  463. package/streaming.d.ts +3 -0
  464. package/streaming.d.ts.map +1 -0
  465. package/streaming.js +9 -0
  466. package/streaming.js.map +1 -0
  467. package/streaming.mjs +6 -0
  468. package/streaming.mjs.map +1 -0
  469. package/version.d.mts +1 -1
  470. package/version.d.ts +1 -1
  471. package/version.js +1 -1
  472. package/version.mjs +1 -1
  473. package/skills/x-twitter-scraper/references/types-rest-api-vs-mcp-field-naming.md +0 -15
@@ -0,0 +1,3947 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6
+
7
+ import { APIResource } from '../../core/resource';
8
+ import * as Shared from '../shared';
9
+ import { APIPromise } from '../../core/api-promise';
10
+ import { RequestOptions } from '../../internal/request-options';
11
+
12
+ /**
13
+ * AI analysis of posts, at 2 credits per analyzed post
14
+ */
15
+ export class Analysis extends APIResource {
16
+ /**
17
+ * Answers whether each post is about your brand, the author's attitude toward it &
18
+ * the author's relationship with it. Name the brand in analysis.targets. Each
19
+ * analyzed post costs 2 credits.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const response = await client.x.analysis.brand({
24
+ * limit: 20,
25
+ * query: 'Artemis lang:en',
26
+ * queryType: 'Latest',
27
+ * sinceTime: '2026-09-01T00:00:00Z',
28
+ * untilTime: '2026-09-30T23:59:59Z',
29
+ * });
30
+ * ```
31
+ */
32
+ brand(body: AnalysisBrandParams, options?: RequestOptions): APIPromise<AnalysisBrandResponse> {
33
+ return this._client.post('/x/analysis/brand', { body, ...options });
34
+ }
35
+
36
+ /**
37
+ * Answers 1 to 8 questions you write in analysis.questions. A choice picks a
38
+ * category, such as a topic. A score picks a level. A probability answers yes or
39
+ * no. Without questions it answers the sentiment questions. Each analyzed post
40
+ * costs 2 credits.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response = await client.x.analysis.classify({
45
+ * limit: 20,
46
+ * query: 'Artemis lang:en',
47
+ * queryType: 'Latest',
48
+ * sinceTime: '2026-09-01T00:00:00Z',
49
+ * untilTime: '2026-09-30T23:59:59Z',
50
+ * });
51
+ * ```
52
+ */
53
+ classify(body: AnalysisClassifyParams, options?: RequestOptions): APIPromise<AnalysisClassifyResponse> {
54
+ return this._client.post('/x/analysis/classify', { body, ...options });
55
+ }
56
+
57
+ /**
58
+ * Answers each post's stance on an asset, its content type, its conviction & its
59
+ * relevance. The summary counts bullish & bearish posts per cashtag. Name the
60
+ * asset in analysis.targets. Each analyzed post costs 2 credits.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await client.x.analysis.marketSignals({
65
+ * limit: 20,
66
+ * query: 'Artemis lang:en',
67
+ * queryType: 'Latest',
68
+ * sinceTime: '2026-09-01T00:00:00Z',
69
+ * untilTime: '2026-09-30T23:59:59Z',
70
+ * });
71
+ * ```
72
+ */
73
+ marketSignals(
74
+ body: AnalysisMarketSignalsParams,
75
+ options?: RequestOptions,
76
+ ): APIPromise<AnalysisMarketSignalsResponse> {
77
+ return this._client.post('/x/analysis/market-signals', { body, ...options });
78
+ }
79
+
80
+ /**
81
+ * Answers each post's format, such as reporting, commentary or speculation, its
82
+ * source attribution & its relevance to your topic. Name the topic in
83
+ * analysis.targets. Each analyzed post costs 2 credits.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response = await client.x.analysis.news({
88
+ * limit: 20,
89
+ * query: 'Artemis lang:en',
90
+ * queryType: 'Latest',
91
+ * sinceTime: '2026-09-01T00:00:00Z',
92
+ * untilTime: '2026-09-30T23:59:59Z',
93
+ * });
94
+ * ```
95
+ */
96
+ news(body: AnalysisNewsParams, options?: RequestOptions): APIPromise<AnalysisNewsResponse> {
97
+ return this._client.post('/x/analysis/news', { body, ...options });
98
+ }
99
+
100
+ /**
101
+ * Answers each post's attitude, its intensity & its sarcasm probability. Send post
102
+ * IDs, an X search, an account, a List, a post's replies or quotes, or your own
103
+ * texts. Each analyzed post costs 2 credits. A post without an analysis costs
104
+ * nothing.
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const response = await client.x.analysis.sentiment({
109
+ * limit: 20,
110
+ * query: 'Artemis lang:en',
111
+ * queryType: 'Latest',
112
+ * sinceTime: '2026-09-01T00:00:00Z',
113
+ * untilTime: '2026-09-30T23:59:59Z',
114
+ * });
115
+ * ```
116
+ */
117
+ sentiment(body: AnalysisSentimentParams, options?: RequestOptions): APIPromise<AnalysisSentimentResponse> {
118
+ return this._client.post('/x/analysis/sentiment', { body, ...options });
119
+ }
120
+
121
+ /**
122
+ * Answers each post's hook, clarity, payoff, humor, spam risk & likely reaction, &
123
+ * adds a Viral Score from 0 to 100 with a verdict. The score rates the wording. It
124
+ * does not predict likes or views. Send drafts in texts to score them before
125
+ * posting. Each analyzed post costs 2 credits.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const response = await client.x.analysis.viralScore({
130
+ * limit: 20,
131
+ * query: 'Artemis lang:en',
132
+ * queryType: 'Latest',
133
+ * sinceTime: '2026-09-01T00:00:00Z',
134
+ * untilTime: '2026-09-30T23:59:59Z',
135
+ * });
136
+ * ```
137
+ */
138
+ viralScore(
139
+ body: AnalysisViralScoreParams,
140
+ options?: RequestOptions,
141
+ ): APIPromise<AnalysisViralScoreResponse> {
142
+ return this._client.post('/x/analysis/viral-score', { body, ...options });
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
148
+ * row in results costs 2 credits.
149
+ */
150
+ export interface AnalysisBrandResponse {
151
+ /**
152
+ * Totals of the answers across the analyzed posts.
153
+ */
154
+ analysisSummary: AnalysisBrandResponse.AnalysisSummary;
155
+
156
+ /**
157
+ * Whether the search has more posts. Send next_cursor as cursor.
158
+ */
159
+ has_next_page: boolean;
160
+
161
+ /**
162
+ * Cursor of the search's next page, else empty.
163
+ */
164
+ next_cursor: string;
165
+
166
+ /**
167
+ * Each analyzed post with its answers.
168
+ */
169
+ results: Array<AnalysisBrandResponse.Result>;
170
+
171
+ /**
172
+ * Each post without an analysis, by ID & reason. These cost nothing.
173
+ */
174
+ unanalyzed: Array<AnalysisBrandResponse.Unanalyzed>;
175
+ }
176
+
177
+ export namespace AnalysisBrandResponse {
178
+ /**
179
+ * Totals of the answers across the analyzed posts.
180
+ */
181
+ export interface AnalysisSummary {
182
+ /**
183
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
184
+ * the market questions.
185
+ */
186
+ cashtags: Array<AnalysisSummary.Cashtag>;
187
+
188
+ /**
189
+ * Likes, reposts, replies & quotes of the analyzed posts.
190
+ */
191
+ engagement: number;
192
+
193
+ /**
194
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
195
+ * when the answer holds no post.
196
+ */
197
+ monitor: AnalysisSummary.Monitor | null;
198
+
199
+ /**
200
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
201
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
202
+ * has mean, yes & no.
203
+ */
204
+ questions: { [key: string]: { [key: string]: unknown } };
205
+
206
+ /**
207
+ * Posts by analysis outcome.
208
+ */
209
+ rows: AnalysisSummary.Rows;
210
+
211
+ schemaVersion: number;
212
+
213
+ /**
214
+ * Posts per linked hostname, most posts first, up to 20.
215
+ */
216
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
217
+
218
+ /**
219
+ * Mentions & answers per target in analysis.targets.
220
+ */
221
+ targets: Array<AnalysisSummary.Target>;
222
+
223
+ /**
224
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
225
+ * counts, the scores against actual engagement, a report per author & the
226
+ * leaderboards.
227
+ */
228
+ viral?: { [key: string]: unknown };
229
+ }
230
+
231
+ export namespace AnalysisSummary {
232
+ export interface Cashtag {
233
+ cashtag: string;
234
+
235
+ /**
236
+ * Category counts of the cashtag's posts by question ID.
237
+ */
238
+ choices: { [key: string]: unknown };
239
+
240
+ rows: number;
241
+
242
+ signal?: Cashtag.Signal;
243
+ }
244
+
245
+ export namespace Cashtag {
246
+ export interface Signal {
247
+ bearish: number;
248
+
249
+ bullish: number;
250
+
251
+ /**
252
+ * Bullish minus bearish posts, over all posts.
253
+ */
254
+ score: number;
255
+ }
256
+ }
257
+
258
+ /**
259
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
260
+ * when the answer holds no post.
261
+ */
262
+ export interface Monitor {
263
+ changedRows: Array<Monitor.ChangedRow>;
264
+
265
+ /**
266
+ * Posts per monitor status.
267
+ */
268
+ statuses: { [key: string]: number };
269
+ }
270
+
271
+ export namespace Monitor {
272
+ export interface ChangedRow {
273
+ changes: Array<ChangedRow.Change>;
274
+
275
+ tweetId: string;
276
+ }
277
+
278
+ export namespace ChangedRow {
279
+ export interface Change {
280
+ current: string;
281
+
282
+ previous: string;
283
+
284
+ questionId: string;
285
+ }
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Posts by analysis outcome.
291
+ */
292
+ export interface Rows {
293
+ analyzed: number;
294
+
295
+ failed: number;
296
+
297
+ skipped: number;
298
+ }
299
+
300
+ export interface SourceDomain {
301
+ domain: string;
302
+
303
+ posts: number;
304
+ }
305
+
306
+ export interface Target {
307
+ /**
308
+ * Category counts by question ID.
309
+ */
310
+ choices: { [key: string]: unknown };
311
+
312
+ engagement: number;
313
+
314
+ mentions: number;
315
+
316
+ name: string;
317
+
318
+ share: number;
319
+
320
+ /**
321
+ * The most engaged posts per question ID & category.
322
+ */
323
+ top: { [key: string]: unknown };
324
+ }
325
+ }
326
+
327
+ /**
328
+ * 1 analyzed post with its answers.
329
+ */
330
+ export interface Result {
331
+ /**
332
+ * The answers in full, with their probabilities.
333
+ */
334
+ analysis: Result.Analysis;
335
+
336
+ /**
337
+ * Each question's decision by question ID. A choice gives its category, a score
338
+ * its level from 0, which can have decimals, & a probability its value from 0 to
339
+ * 1.
340
+ */
341
+ answers: { [key: string]: string | number };
342
+
343
+ /**
344
+ * Cashtags in the post's text, in upper case.
345
+ */
346
+ cashtags: Array<string>;
347
+
348
+ /**
349
+ * How the post's answers compare with its row in baseline, as the AI Actors
350
+ * compare a run with an earlier dataset.
351
+ */
352
+ monitor: Result.Monitor;
353
+
354
+ /**
355
+ * Hostnames the post links to, without t.co.
356
+ */
357
+ sourceDomains: Array<string>;
358
+
359
+ /**
360
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
361
+ * text:2 & so on.
362
+ */
363
+ tweet: Shared.SearchTweet;
364
+
365
+ /**
366
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
367
+ * that applied & the engagement comparison.
368
+ */
369
+ viral?: { [key: string]: unknown };
370
+
371
+ /**
372
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
373
+ * 1,000 followers. Null without a follower count.
374
+ */
375
+ viralActualEngagementRate?: number | null;
376
+
377
+ /**
378
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
379
+ * ranking weights, per 1,000 views or followers.
380
+ */
381
+ viralAlgorithmScore?: number | null;
382
+
383
+ /**
384
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
385
+ * trait has no answer.
386
+ */
387
+ viralScore?: number | null;
388
+
389
+ /**
390
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
391
+ * sleep_on_it.
392
+ */
393
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
394
+ }
395
+
396
+ export namespace Result {
397
+ /**
398
+ * The answers in full, with their probabilities.
399
+ */
400
+ export interface Analysis {
401
+ /**
402
+ * 1 answer per question, in question order.
403
+ */
404
+ answers: Array<Analysis.Answer>;
405
+
406
+ /**
407
+ * What the AI read beside the post's text.
408
+ */
409
+ contextAvailability: Analysis.ContextAvailability;
410
+
411
+ /**
412
+ * Bytes of post & settings the AI read.
413
+ */
414
+ contextBytes: number;
415
+
416
+ /**
417
+ * The ID & version of each question asked.
418
+ */
419
+ questions: Array<Analysis.Question>;
420
+
421
+ status: 'succeeded';
422
+ }
423
+
424
+ export namespace Analysis {
425
+ /**
426
+ * 1 question's answer. A probability has probability. A choice or score has value,
427
+ * confidence & the probability of each category or level.
428
+ */
429
+ export interface Answer {
430
+ questionId: string;
431
+
432
+ questionVersion: string;
433
+
434
+ type: 'choice' | 'score' | 'probability';
435
+
436
+ confidence?: number;
437
+
438
+ /**
439
+ * For a score. The levels the question named, from 0.
440
+ */
441
+ levels?: Array<string>;
442
+
443
+ /**
444
+ * Probability of each category, or of each level by index.
445
+ */
446
+ probabilities?: { [key: string]: number };
447
+
448
+ /**
449
+ * For a probability. The chance the answer is yes.
450
+ */
451
+ probability?: number;
452
+
453
+ /**
454
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
455
+ * between levels 1 & 2.
456
+ */
457
+ value?: string | number;
458
+ }
459
+
460
+ /**
461
+ * What the AI read beside the post's text.
462
+ */
463
+ export interface ContextAvailability {
464
+ article: 'text_blocks' | 'summary' | 'not_supplied';
465
+
466
+ author: 'available' | 'missing';
467
+
468
+ media: 'text_descriptions_only' | 'not_supplied';
469
+
470
+ /**
471
+ * truncated when the post was cut to fit.
472
+ */
473
+ postText: 'full' | 'truncated';
474
+
475
+ quote: 'available' | 'missing' | 'not_applicable';
476
+
477
+ reply: 'available' | 'missing' | 'not_applicable';
478
+ }
479
+
480
+ export interface Question {
481
+ id: string;
482
+
483
+ version: string;
484
+ }
485
+ }
486
+
487
+ /**
488
+ * How the post's answers compare with its row in baseline, as the AI Actors
489
+ * compare a run with an earlier dataset.
490
+ */
491
+ export interface Monitor {
492
+ /**
493
+ * Always null. The baseline is the rows you sent.
494
+ */
495
+ baselineDatasetId: null;
496
+
497
+ /**
498
+ * IDs of the questions whose decision changed.
499
+ */
500
+ changedQuestionIds: Array<string>;
501
+
502
+ /**
503
+ * Each changed decision, earlier & now.
504
+ */
505
+ changes: Array<Monitor.Change>;
506
+
507
+ /**
508
+ * Hash of the questions, targets & context. Rows with another hash are
509
+ * not_comparable.
510
+ */
511
+ configurationFingerprint: string;
512
+
513
+ /**
514
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
515
+ * when an answer clearly left its earlier decision. not_comparable when other
516
+ * settings made the earlier row or it answers none of these questions.
517
+ */
518
+ status:
519
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
520
+ }
521
+
522
+ export namespace Monitor {
523
+ export interface Change {
524
+ current: string;
525
+
526
+ previous: string;
527
+
528
+ questionId: string;
529
+ }
530
+ }
531
+ }
532
+
533
+ /**
534
+ * A post without an analysis. It costs nothing.
535
+ */
536
+ export interface Unanalyzed {
537
+ /**
538
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
539
+ */
540
+ id: string;
541
+
542
+ /**
543
+ * post_unavailable when X returns no such post. missing_text for a post without
544
+ * text. insufficient_credits when credits ran out. context_limit when the settings
545
+ * leave the post no room. The other reasons mean the analysis failed. Send the
546
+ * post again.
547
+ */
548
+ reason: string;
549
+
550
+ status: 'failed' | 'skipped';
551
+ }
552
+ }
553
+
554
+ /**
555
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
556
+ * row in results costs 2 credits.
557
+ */
558
+ export interface AnalysisClassifyResponse {
559
+ /**
560
+ * Totals of the answers across the analyzed posts.
561
+ */
562
+ analysisSummary: AnalysisClassifyResponse.AnalysisSummary;
563
+
564
+ /**
565
+ * Whether the search has more posts. Send next_cursor as cursor.
566
+ */
567
+ has_next_page: boolean;
568
+
569
+ /**
570
+ * Cursor of the search's next page, else empty.
571
+ */
572
+ next_cursor: string;
573
+
574
+ /**
575
+ * Each analyzed post with its answers.
576
+ */
577
+ results: Array<AnalysisClassifyResponse.Result>;
578
+
579
+ /**
580
+ * Each post without an analysis, by ID & reason. These cost nothing.
581
+ */
582
+ unanalyzed: Array<AnalysisClassifyResponse.Unanalyzed>;
583
+ }
584
+
585
+ export namespace AnalysisClassifyResponse {
586
+ /**
587
+ * Totals of the answers across the analyzed posts.
588
+ */
589
+ export interface AnalysisSummary {
590
+ /**
591
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
592
+ * the market questions.
593
+ */
594
+ cashtags: Array<AnalysisSummary.Cashtag>;
595
+
596
+ /**
597
+ * Likes, reposts, replies & quotes of the analyzed posts.
598
+ */
599
+ engagement: number;
600
+
601
+ /**
602
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
603
+ * when the answer holds no post.
604
+ */
605
+ monitor: AnalysisSummary.Monitor | null;
606
+
607
+ /**
608
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
609
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
610
+ * has mean, yes & no.
611
+ */
612
+ questions: { [key: string]: { [key: string]: unknown } };
613
+
614
+ /**
615
+ * Posts by analysis outcome.
616
+ */
617
+ rows: AnalysisSummary.Rows;
618
+
619
+ schemaVersion: number;
620
+
621
+ /**
622
+ * Posts per linked hostname, most posts first, up to 20.
623
+ */
624
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
625
+
626
+ /**
627
+ * Mentions & answers per target in analysis.targets.
628
+ */
629
+ targets: Array<AnalysisSummary.Target>;
630
+
631
+ /**
632
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
633
+ * counts, the scores against actual engagement, a report per author & the
634
+ * leaderboards.
635
+ */
636
+ viral?: { [key: string]: unknown };
637
+ }
638
+
639
+ export namespace AnalysisSummary {
640
+ export interface Cashtag {
641
+ cashtag: string;
642
+
643
+ /**
644
+ * Category counts of the cashtag's posts by question ID.
645
+ */
646
+ choices: { [key: string]: unknown };
647
+
648
+ rows: number;
649
+
650
+ signal?: Cashtag.Signal;
651
+ }
652
+
653
+ export namespace Cashtag {
654
+ export interface Signal {
655
+ bearish: number;
656
+
657
+ bullish: number;
658
+
659
+ /**
660
+ * Bullish minus bearish posts, over all posts.
661
+ */
662
+ score: number;
663
+ }
664
+ }
665
+
666
+ /**
667
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
668
+ * when the answer holds no post.
669
+ */
670
+ export interface Monitor {
671
+ changedRows: Array<Monitor.ChangedRow>;
672
+
673
+ /**
674
+ * Posts per monitor status.
675
+ */
676
+ statuses: { [key: string]: number };
677
+ }
678
+
679
+ export namespace Monitor {
680
+ export interface ChangedRow {
681
+ changes: Array<ChangedRow.Change>;
682
+
683
+ tweetId: string;
684
+ }
685
+
686
+ export namespace ChangedRow {
687
+ export interface Change {
688
+ current: string;
689
+
690
+ previous: string;
691
+
692
+ questionId: string;
693
+ }
694
+ }
695
+ }
696
+
697
+ /**
698
+ * Posts by analysis outcome.
699
+ */
700
+ export interface Rows {
701
+ analyzed: number;
702
+
703
+ failed: number;
704
+
705
+ skipped: number;
706
+ }
707
+
708
+ export interface SourceDomain {
709
+ domain: string;
710
+
711
+ posts: number;
712
+ }
713
+
714
+ export interface Target {
715
+ /**
716
+ * Category counts by question ID.
717
+ */
718
+ choices: { [key: string]: unknown };
719
+
720
+ engagement: number;
721
+
722
+ mentions: number;
723
+
724
+ name: string;
725
+
726
+ share: number;
727
+
728
+ /**
729
+ * The most engaged posts per question ID & category.
730
+ */
731
+ top: { [key: string]: unknown };
732
+ }
733
+ }
734
+
735
+ /**
736
+ * 1 analyzed post with its answers.
737
+ */
738
+ export interface Result {
739
+ /**
740
+ * The answers in full, with their probabilities.
741
+ */
742
+ analysis: Result.Analysis;
743
+
744
+ /**
745
+ * Each question's decision by question ID. A choice gives its category, a score
746
+ * its level from 0, which can have decimals, & a probability its value from 0 to
747
+ * 1.
748
+ */
749
+ answers: { [key: string]: string | number };
750
+
751
+ /**
752
+ * Cashtags in the post's text, in upper case.
753
+ */
754
+ cashtags: Array<string>;
755
+
756
+ /**
757
+ * How the post's answers compare with its row in baseline, as the AI Actors
758
+ * compare a run with an earlier dataset.
759
+ */
760
+ monitor: Result.Monitor;
761
+
762
+ /**
763
+ * Hostnames the post links to, without t.co.
764
+ */
765
+ sourceDomains: Array<string>;
766
+
767
+ /**
768
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
769
+ * text:2 & so on.
770
+ */
771
+ tweet: Shared.SearchTweet;
772
+
773
+ /**
774
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
775
+ * that applied & the engagement comparison.
776
+ */
777
+ viral?: { [key: string]: unknown };
778
+
779
+ /**
780
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
781
+ * 1,000 followers. Null without a follower count.
782
+ */
783
+ viralActualEngagementRate?: number | null;
784
+
785
+ /**
786
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
787
+ * ranking weights, per 1,000 views or followers.
788
+ */
789
+ viralAlgorithmScore?: number | null;
790
+
791
+ /**
792
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
793
+ * trait has no answer.
794
+ */
795
+ viralScore?: number | null;
796
+
797
+ /**
798
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
799
+ * sleep_on_it.
800
+ */
801
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
802
+ }
803
+
804
+ export namespace Result {
805
+ /**
806
+ * The answers in full, with their probabilities.
807
+ */
808
+ export interface Analysis {
809
+ /**
810
+ * 1 answer per question, in question order.
811
+ */
812
+ answers: Array<Analysis.Answer>;
813
+
814
+ /**
815
+ * What the AI read beside the post's text.
816
+ */
817
+ contextAvailability: Analysis.ContextAvailability;
818
+
819
+ /**
820
+ * Bytes of post & settings the AI read.
821
+ */
822
+ contextBytes: number;
823
+
824
+ /**
825
+ * The ID & version of each question asked.
826
+ */
827
+ questions: Array<Analysis.Question>;
828
+
829
+ status: 'succeeded';
830
+ }
831
+
832
+ export namespace Analysis {
833
+ /**
834
+ * 1 question's answer. A probability has probability. A choice or score has value,
835
+ * confidence & the probability of each category or level.
836
+ */
837
+ export interface Answer {
838
+ questionId: string;
839
+
840
+ questionVersion: string;
841
+
842
+ type: 'choice' | 'score' | 'probability';
843
+
844
+ confidence?: number;
845
+
846
+ /**
847
+ * For a score. The levels the question named, from 0.
848
+ */
849
+ levels?: Array<string>;
850
+
851
+ /**
852
+ * Probability of each category, or of each level by index.
853
+ */
854
+ probabilities?: { [key: string]: number };
855
+
856
+ /**
857
+ * For a probability. The chance the answer is yes.
858
+ */
859
+ probability?: number;
860
+
861
+ /**
862
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
863
+ * between levels 1 & 2.
864
+ */
865
+ value?: string | number;
866
+ }
867
+
868
+ /**
869
+ * What the AI read beside the post's text.
870
+ */
871
+ export interface ContextAvailability {
872
+ article: 'text_blocks' | 'summary' | 'not_supplied';
873
+
874
+ author: 'available' | 'missing';
875
+
876
+ media: 'text_descriptions_only' | 'not_supplied';
877
+
878
+ /**
879
+ * truncated when the post was cut to fit.
880
+ */
881
+ postText: 'full' | 'truncated';
882
+
883
+ quote: 'available' | 'missing' | 'not_applicable';
884
+
885
+ reply: 'available' | 'missing' | 'not_applicable';
886
+ }
887
+
888
+ export interface Question {
889
+ id: string;
890
+
891
+ version: string;
892
+ }
893
+ }
894
+
895
+ /**
896
+ * How the post's answers compare with its row in baseline, as the AI Actors
897
+ * compare a run with an earlier dataset.
898
+ */
899
+ export interface Monitor {
900
+ /**
901
+ * Always null. The baseline is the rows you sent.
902
+ */
903
+ baselineDatasetId: null;
904
+
905
+ /**
906
+ * IDs of the questions whose decision changed.
907
+ */
908
+ changedQuestionIds: Array<string>;
909
+
910
+ /**
911
+ * Each changed decision, earlier & now.
912
+ */
913
+ changes: Array<Monitor.Change>;
914
+
915
+ /**
916
+ * Hash of the questions, targets & context. Rows with another hash are
917
+ * not_comparable.
918
+ */
919
+ configurationFingerprint: string;
920
+
921
+ /**
922
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
923
+ * when an answer clearly left its earlier decision. not_comparable when other
924
+ * settings made the earlier row or it answers none of these questions.
925
+ */
926
+ status:
927
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
928
+ }
929
+
930
+ export namespace Monitor {
931
+ export interface Change {
932
+ current: string;
933
+
934
+ previous: string;
935
+
936
+ questionId: string;
937
+ }
938
+ }
939
+ }
940
+
941
+ /**
942
+ * A post without an analysis. It costs nothing.
943
+ */
944
+ export interface Unanalyzed {
945
+ /**
946
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
947
+ */
948
+ id: string;
949
+
950
+ /**
951
+ * post_unavailable when X returns no such post. missing_text for a post without
952
+ * text. insufficient_credits when credits ran out. context_limit when the settings
953
+ * leave the post no room. The other reasons mean the analysis failed. Send the
954
+ * post again.
955
+ */
956
+ reason: string;
957
+
958
+ status: 'failed' | 'skipped';
959
+ }
960
+ }
961
+
962
+ /**
963
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
964
+ * row in results costs 2 credits.
965
+ */
966
+ export interface AnalysisMarketSignalsResponse {
967
+ /**
968
+ * Totals of the answers across the analyzed posts.
969
+ */
970
+ analysisSummary: AnalysisMarketSignalsResponse.AnalysisSummary;
971
+
972
+ /**
973
+ * Whether the search has more posts. Send next_cursor as cursor.
974
+ */
975
+ has_next_page: boolean;
976
+
977
+ /**
978
+ * Cursor of the search's next page, else empty.
979
+ */
980
+ next_cursor: string;
981
+
982
+ /**
983
+ * Each analyzed post with its answers.
984
+ */
985
+ results: Array<AnalysisMarketSignalsResponse.Result>;
986
+
987
+ /**
988
+ * Each post without an analysis, by ID & reason. These cost nothing.
989
+ */
990
+ unanalyzed: Array<AnalysisMarketSignalsResponse.Unanalyzed>;
991
+ }
992
+
993
+ export namespace AnalysisMarketSignalsResponse {
994
+ /**
995
+ * Totals of the answers across the analyzed posts.
996
+ */
997
+ export interface AnalysisSummary {
998
+ /**
999
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
1000
+ * the market questions.
1001
+ */
1002
+ cashtags: Array<AnalysisSummary.Cashtag>;
1003
+
1004
+ /**
1005
+ * Likes, reposts, replies & quotes of the analyzed posts.
1006
+ */
1007
+ engagement: number;
1008
+
1009
+ /**
1010
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1011
+ * when the answer holds no post.
1012
+ */
1013
+ monitor: AnalysisSummary.Monitor | null;
1014
+
1015
+ /**
1016
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
1017
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
1018
+ * has mean, yes & no.
1019
+ */
1020
+ questions: { [key: string]: { [key: string]: unknown } };
1021
+
1022
+ /**
1023
+ * Posts by analysis outcome.
1024
+ */
1025
+ rows: AnalysisSummary.Rows;
1026
+
1027
+ schemaVersion: number;
1028
+
1029
+ /**
1030
+ * Posts per linked hostname, most posts first, up to 20.
1031
+ */
1032
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
1033
+
1034
+ /**
1035
+ * Mentions & answers per target in analysis.targets.
1036
+ */
1037
+ targets: Array<AnalysisSummary.Target>;
1038
+
1039
+ /**
1040
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
1041
+ * counts, the scores against actual engagement, a report per author & the
1042
+ * leaderboards.
1043
+ */
1044
+ viral?: { [key: string]: unknown };
1045
+ }
1046
+
1047
+ export namespace AnalysisSummary {
1048
+ export interface Cashtag {
1049
+ cashtag: string;
1050
+
1051
+ /**
1052
+ * Category counts of the cashtag's posts by question ID.
1053
+ */
1054
+ choices: { [key: string]: unknown };
1055
+
1056
+ rows: number;
1057
+
1058
+ signal?: Cashtag.Signal;
1059
+ }
1060
+
1061
+ export namespace Cashtag {
1062
+ export interface Signal {
1063
+ bearish: number;
1064
+
1065
+ bullish: number;
1066
+
1067
+ /**
1068
+ * Bullish minus bearish posts, over all posts.
1069
+ */
1070
+ score: number;
1071
+ }
1072
+ }
1073
+
1074
+ /**
1075
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1076
+ * when the answer holds no post.
1077
+ */
1078
+ export interface Monitor {
1079
+ changedRows: Array<Monitor.ChangedRow>;
1080
+
1081
+ /**
1082
+ * Posts per monitor status.
1083
+ */
1084
+ statuses: { [key: string]: number };
1085
+ }
1086
+
1087
+ export namespace Monitor {
1088
+ export interface ChangedRow {
1089
+ changes: Array<ChangedRow.Change>;
1090
+
1091
+ tweetId: string;
1092
+ }
1093
+
1094
+ export namespace ChangedRow {
1095
+ export interface Change {
1096
+ current: string;
1097
+
1098
+ previous: string;
1099
+
1100
+ questionId: string;
1101
+ }
1102
+ }
1103
+ }
1104
+
1105
+ /**
1106
+ * Posts by analysis outcome.
1107
+ */
1108
+ export interface Rows {
1109
+ analyzed: number;
1110
+
1111
+ failed: number;
1112
+
1113
+ skipped: number;
1114
+ }
1115
+
1116
+ export interface SourceDomain {
1117
+ domain: string;
1118
+
1119
+ posts: number;
1120
+ }
1121
+
1122
+ export interface Target {
1123
+ /**
1124
+ * Category counts by question ID.
1125
+ */
1126
+ choices: { [key: string]: unknown };
1127
+
1128
+ engagement: number;
1129
+
1130
+ mentions: number;
1131
+
1132
+ name: string;
1133
+
1134
+ share: number;
1135
+
1136
+ /**
1137
+ * The most engaged posts per question ID & category.
1138
+ */
1139
+ top: { [key: string]: unknown };
1140
+ }
1141
+ }
1142
+
1143
+ /**
1144
+ * 1 analyzed post with its answers.
1145
+ */
1146
+ export interface Result {
1147
+ /**
1148
+ * The answers in full, with their probabilities.
1149
+ */
1150
+ analysis: Result.Analysis;
1151
+
1152
+ /**
1153
+ * Each question's decision by question ID. A choice gives its category, a score
1154
+ * its level from 0, which can have decimals, & a probability its value from 0 to
1155
+ * 1.
1156
+ */
1157
+ answers: { [key: string]: string | number };
1158
+
1159
+ /**
1160
+ * Cashtags in the post's text, in upper case.
1161
+ */
1162
+ cashtags: Array<string>;
1163
+
1164
+ /**
1165
+ * How the post's answers compare with its row in baseline, as the AI Actors
1166
+ * compare a run with an earlier dataset.
1167
+ */
1168
+ monitor: Result.Monitor;
1169
+
1170
+ /**
1171
+ * Hostnames the post links to, without t.co.
1172
+ */
1173
+ sourceDomains: Array<string>;
1174
+
1175
+ /**
1176
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
1177
+ * text:2 & so on.
1178
+ */
1179
+ tweet: Shared.SearchTweet;
1180
+
1181
+ /**
1182
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
1183
+ * that applied & the engagement comparison.
1184
+ */
1185
+ viral?: { [key: string]: unknown };
1186
+
1187
+ /**
1188
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
1189
+ * 1,000 followers. Null without a follower count.
1190
+ */
1191
+ viralActualEngagementRate?: number | null;
1192
+
1193
+ /**
1194
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
1195
+ * ranking weights, per 1,000 views or followers.
1196
+ */
1197
+ viralAlgorithmScore?: number | null;
1198
+
1199
+ /**
1200
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
1201
+ * trait has no answer.
1202
+ */
1203
+ viralScore?: number | null;
1204
+
1205
+ /**
1206
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
1207
+ * sleep_on_it.
1208
+ */
1209
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
1210
+ }
1211
+
1212
+ export namespace Result {
1213
+ /**
1214
+ * The answers in full, with their probabilities.
1215
+ */
1216
+ export interface Analysis {
1217
+ /**
1218
+ * 1 answer per question, in question order.
1219
+ */
1220
+ answers: Array<Analysis.Answer>;
1221
+
1222
+ /**
1223
+ * What the AI read beside the post's text.
1224
+ */
1225
+ contextAvailability: Analysis.ContextAvailability;
1226
+
1227
+ /**
1228
+ * Bytes of post & settings the AI read.
1229
+ */
1230
+ contextBytes: number;
1231
+
1232
+ /**
1233
+ * The ID & version of each question asked.
1234
+ */
1235
+ questions: Array<Analysis.Question>;
1236
+
1237
+ status: 'succeeded';
1238
+ }
1239
+
1240
+ export namespace Analysis {
1241
+ /**
1242
+ * 1 question's answer. A probability has probability. A choice or score has value,
1243
+ * confidence & the probability of each category or level.
1244
+ */
1245
+ export interface Answer {
1246
+ questionId: string;
1247
+
1248
+ questionVersion: string;
1249
+
1250
+ type: 'choice' | 'score' | 'probability';
1251
+
1252
+ confidence?: number;
1253
+
1254
+ /**
1255
+ * For a score. The levels the question named, from 0.
1256
+ */
1257
+ levels?: Array<string>;
1258
+
1259
+ /**
1260
+ * Probability of each category, or of each level by index.
1261
+ */
1262
+ probabilities?: { [key: string]: number };
1263
+
1264
+ /**
1265
+ * For a probability. The chance the answer is yes.
1266
+ */
1267
+ probability?: number;
1268
+
1269
+ /**
1270
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
1271
+ * between levels 1 & 2.
1272
+ */
1273
+ value?: string | number;
1274
+ }
1275
+
1276
+ /**
1277
+ * What the AI read beside the post's text.
1278
+ */
1279
+ export interface ContextAvailability {
1280
+ article: 'text_blocks' | 'summary' | 'not_supplied';
1281
+
1282
+ author: 'available' | 'missing';
1283
+
1284
+ media: 'text_descriptions_only' | 'not_supplied';
1285
+
1286
+ /**
1287
+ * truncated when the post was cut to fit.
1288
+ */
1289
+ postText: 'full' | 'truncated';
1290
+
1291
+ quote: 'available' | 'missing' | 'not_applicable';
1292
+
1293
+ reply: 'available' | 'missing' | 'not_applicable';
1294
+ }
1295
+
1296
+ export interface Question {
1297
+ id: string;
1298
+
1299
+ version: string;
1300
+ }
1301
+ }
1302
+
1303
+ /**
1304
+ * How the post's answers compare with its row in baseline, as the AI Actors
1305
+ * compare a run with an earlier dataset.
1306
+ */
1307
+ export interface Monitor {
1308
+ /**
1309
+ * Always null. The baseline is the rows you sent.
1310
+ */
1311
+ baselineDatasetId: null;
1312
+
1313
+ /**
1314
+ * IDs of the questions whose decision changed.
1315
+ */
1316
+ changedQuestionIds: Array<string>;
1317
+
1318
+ /**
1319
+ * Each changed decision, earlier & now.
1320
+ */
1321
+ changes: Array<Monitor.Change>;
1322
+
1323
+ /**
1324
+ * Hash of the questions, targets & context. Rows with another hash are
1325
+ * not_comparable.
1326
+ */
1327
+ configurationFingerprint: string;
1328
+
1329
+ /**
1330
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
1331
+ * when an answer clearly left its earlier decision. not_comparable when other
1332
+ * settings made the earlier row or it answers none of these questions.
1333
+ */
1334
+ status:
1335
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
1336
+ }
1337
+
1338
+ export namespace Monitor {
1339
+ export interface Change {
1340
+ current: string;
1341
+
1342
+ previous: string;
1343
+
1344
+ questionId: string;
1345
+ }
1346
+ }
1347
+ }
1348
+
1349
+ /**
1350
+ * A post without an analysis. It costs nothing.
1351
+ */
1352
+ export interface Unanalyzed {
1353
+ /**
1354
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
1355
+ */
1356
+ id: string;
1357
+
1358
+ /**
1359
+ * post_unavailable when X returns no such post. missing_text for a post without
1360
+ * text. insufficient_credits when credits ran out. context_limit when the settings
1361
+ * leave the post no room. The other reasons mean the analysis failed. Send the
1362
+ * post again.
1363
+ */
1364
+ reason: string;
1365
+
1366
+ status: 'failed' | 'skipped';
1367
+ }
1368
+ }
1369
+
1370
+ /**
1371
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
1372
+ * row in results costs 2 credits.
1373
+ */
1374
+ export interface AnalysisNewsResponse {
1375
+ /**
1376
+ * Totals of the answers across the analyzed posts.
1377
+ */
1378
+ analysisSummary: AnalysisNewsResponse.AnalysisSummary;
1379
+
1380
+ /**
1381
+ * Whether the search has more posts. Send next_cursor as cursor.
1382
+ */
1383
+ has_next_page: boolean;
1384
+
1385
+ /**
1386
+ * Cursor of the search's next page, else empty.
1387
+ */
1388
+ next_cursor: string;
1389
+
1390
+ /**
1391
+ * Each analyzed post with its answers.
1392
+ */
1393
+ results: Array<AnalysisNewsResponse.Result>;
1394
+
1395
+ /**
1396
+ * Each post without an analysis, by ID & reason. These cost nothing.
1397
+ */
1398
+ unanalyzed: Array<AnalysisNewsResponse.Unanalyzed>;
1399
+ }
1400
+
1401
+ export namespace AnalysisNewsResponse {
1402
+ /**
1403
+ * Totals of the answers across the analyzed posts.
1404
+ */
1405
+ export interface AnalysisSummary {
1406
+ /**
1407
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
1408
+ * the market questions.
1409
+ */
1410
+ cashtags: Array<AnalysisSummary.Cashtag>;
1411
+
1412
+ /**
1413
+ * Likes, reposts, replies & quotes of the analyzed posts.
1414
+ */
1415
+ engagement: number;
1416
+
1417
+ /**
1418
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1419
+ * when the answer holds no post.
1420
+ */
1421
+ monitor: AnalysisSummary.Monitor | null;
1422
+
1423
+ /**
1424
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
1425
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
1426
+ * has mean, yes & no.
1427
+ */
1428
+ questions: { [key: string]: { [key: string]: unknown } };
1429
+
1430
+ /**
1431
+ * Posts by analysis outcome.
1432
+ */
1433
+ rows: AnalysisSummary.Rows;
1434
+
1435
+ schemaVersion: number;
1436
+
1437
+ /**
1438
+ * Posts per linked hostname, most posts first, up to 20.
1439
+ */
1440
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
1441
+
1442
+ /**
1443
+ * Mentions & answers per target in analysis.targets.
1444
+ */
1445
+ targets: Array<AnalysisSummary.Target>;
1446
+
1447
+ /**
1448
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
1449
+ * counts, the scores against actual engagement, a report per author & the
1450
+ * leaderboards.
1451
+ */
1452
+ viral?: { [key: string]: unknown };
1453
+ }
1454
+
1455
+ export namespace AnalysisSummary {
1456
+ export interface Cashtag {
1457
+ cashtag: string;
1458
+
1459
+ /**
1460
+ * Category counts of the cashtag's posts by question ID.
1461
+ */
1462
+ choices: { [key: string]: unknown };
1463
+
1464
+ rows: number;
1465
+
1466
+ signal?: Cashtag.Signal;
1467
+ }
1468
+
1469
+ export namespace Cashtag {
1470
+ export interface Signal {
1471
+ bearish: number;
1472
+
1473
+ bullish: number;
1474
+
1475
+ /**
1476
+ * Bullish minus bearish posts, over all posts.
1477
+ */
1478
+ score: number;
1479
+ }
1480
+ }
1481
+
1482
+ /**
1483
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1484
+ * when the answer holds no post.
1485
+ */
1486
+ export interface Monitor {
1487
+ changedRows: Array<Monitor.ChangedRow>;
1488
+
1489
+ /**
1490
+ * Posts per monitor status.
1491
+ */
1492
+ statuses: { [key: string]: number };
1493
+ }
1494
+
1495
+ export namespace Monitor {
1496
+ export interface ChangedRow {
1497
+ changes: Array<ChangedRow.Change>;
1498
+
1499
+ tweetId: string;
1500
+ }
1501
+
1502
+ export namespace ChangedRow {
1503
+ export interface Change {
1504
+ current: string;
1505
+
1506
+ previous: string;
1507
+
1508
+ questionId: string;
1509
+ }
1510
+ }
1511
+ }
1512
+
1513
+ /**
1514
+ * Posts by analysis outcome.
1515
+ */
1516
+ export interface Rows {
1517
+ analyzed: number;
1518
+
1519
+ failed: number;
1520
+
1521
+ skipped: number;
1522
+ }
1523
+
1524
+ export interface SourceDomain {
1525
+ domain: string;
1526
+
1527
+ posts: number;
1528
+ }
1529
+
1530
+ export interface Target {
1531
+ /**
1532
+ * Category counts by question ID.
1533
+ */
1534
+ choices: { [key: string]: unknown };
1535
+
1536
+ engagement: number;
1537
+
1538
+ mentions: number;
1539
+
1540
+ name: string;
1541
+
1542
+ share: number;
1543
+
1544
+ /**
1545
+ * The most engaged posts per question ID & category.
1546
+ */
1547
+ top: { [key: string]: unknown };
1548
+ }
1549
+ }
1550
+
1551
+ /**
1552
+ * 1 analyzed post with its answers.
1553
+ */
1554
+ export interface Result {
1555
+ /**
1556
+ * The answers in full, with their probabilities.
1557
+ */
1558
+ analysis: Result.Analysis;
1559
+
1560
+ /**
1561
+ * Each question's decision by question ID. A choice gives its category, a score
1562
+ * its level from 0, which can have decimals, & a probability its value from 0 to
1563
+ * 1.
1564
+ */
1565
+ answers: { [key: string]: string | number };
1566
+
1567
+ /**
1568
+ * Cashtags in the post's text, in upper case.
1569
+ */
1570
+ cashtags: Array<string>;
1571
+
1572
+ /**
1573
+ * How the post's answers compare with its row in baseline, as the AI Actors
1574
+ * compare a run with an earlier dataset.
1575
+ */
1576
+ monitor: Result.Monitor;
1577
+
1578
+ /**
1579
+ * Hostnames the post links to, without t.co.
1580
+ */
1581
+ sourceDomains: Array<string>;
1582
+
1583
+ /**
1584
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
1585
+ * text:2 & so on.
1586
+ */
1587
+ tweet: Shared.SearchTweet;
1588
+
1589
+ /**
1590
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
1591
+ * that applied & the engagement comparison.
1592
+ */
1593
+ viral?: { [key: string]: unknown };
1594
+
1595
+ /**
1596
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
1597
+ * 1,000 followers. Null without a follower count.
1598
+ */
1599
+ viralActualEngagementRate?: number | null;
1600
+
1601
+ /**
1602
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
1603
+ * ranking weights, per 1,000 views or followers.
1604
+ */
1605
+ viralAlgorithmScore?: number | null;
1606
+
1607
+ /**
1608
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
1609
+ * trait has no answer.
1610
+ */
1611
+ viralScore?: number | null;
1612
+
1613
+ /**
1614
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
1615
+ * sleep_on_it.
1616
+ */
1617
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
1618
+ }
1619
+
1620
+ export namespace Result {
1621
+ /**
1622
+ * The answers in full, with their probabilities.
1623
+ */
1624
+ export interface Analysis {
1625
+ /**
1626
+ * 1 answer per question, in question order.
1627
+ */
1628
+ answers: Array<Analysis.Answer>;
1629
+
1630
+ /**
1631
+ * What the AI read beside the post's text.
1632
+ */
1633
+ contextAvailability: Analysis.ContextAvailability;
1634
+
1635
+ /**
1636
+ * Bytes of post & settings the AI read.
1637
+ */
1638
+ contextBytes: number;
1639
+
1640
+ /**
1641
+ * The ID & version of each question asked.
1642
+ */
1643
+ questions: Array<Analysis.Question>;
1644
+
1645
+ status: 'succeeded';
1646
+ }
1647
+
1648
+ export namespace Analysis {
1649
+ /**
1650
+ * 1 question's answer. A probability has probability. A choice or score has value,
1651
+ * confidence & the probability of each category or level.
1652
+ */
1653
+ export interface Answer {
1654
+ questionId: string;
1655
+
1656
+ questionVersion: string;
1657
+
1658
+ type: 'choice' | 'score' | 'probability';
1659
+
1660
+ confidence?: number;
1661
+
1662
+ /**
1663
+ * For a score. The levels the question named, from 0.
1664
+ */
1665
+ levels?: Array<string>;
1666
+
1667
+ /**
1668
+ * Probability of each category, or of each level by index.
1669
+ */
1670
+ probabilities?: { [key: string]: number };
1671
+
1672
+ /**
1673
+ * For a probability. The chance the answer is yes.
1674
+ */
1675
+ probability?: number;
1676
+
1677
+ /**
1678
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
1679
+ * between levels 1 & 2.
1680
+ */
1681
+ value?: string | number;
1682
+ }
1683
+
1684
+ /**
1685
+ * What the AI read beside the post's text.
1686
+ */
1687
+ export interface ContextAvailability {
1688
+ article: 'text_blocks' | 'summary' | 'not_supplied';
1689
+
1690
+ author: 'available' | 'missing';
1691
+
1692
+ media: 'text_descriptions_only' | 'not_supplied';
1693
+
1694
+ /**
1695
+ * truncated when the post was cut to fit.
1696
+ */
1697
+ postText: 'full' | 'truncated';
1698
+
1699
+ quote: 'available' | 'missing' | 'not_applicable';
1700
+
1701
+ reply: 'available' | 'missing' | 'not_applicable';
1702
+ }
1703
+
1704
+ export interface Question {
1705
+ id: string;
1706
+
1707
+ version: string;
1708
+ }
1709
+ }
1710
+
1711
+ /**
1712
+ * How the post's answers compare with its row in baseline, as the AI Actors
1713
+ * compare a run with an earlier dataset.
1714
+ */
1715
+ export interface Monitor {
1716
+ /**
1717
+ * Always null. The baseline is the rows you sent.
1718
+ */
1719
+ baselineDatasetId: null;
1720
+
1721
+ /**
1722
+ * IDs of the questions whose decision changed.
1723
+ */
1724
+ changedQuestionIds: Array<string>;
1725
+
1726
+ /**
1727
+ * Each changed decision, earlier & now.
1728
+ */
1729
+ changes: Array<Monitor.Change>;
1730
+
1731
+ /**
1732
+ * Hash of the questions, targets & context. Rows with another hash are
1733
+ * not_comparable.
1734
+ */
1735
+ configurationFingerprint: string;
1736
+
1737
+ /**
1738
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
1739
+ * when an answer clearly left its earlier decision. not_comparable when other
1740
+ * settings made the earlier row or it answers none of these questions.
1741
+ */
1742
+ status:
1743
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
1744
+ }
1745
+
1746
+ export namespace Monitor {
1747
+ export interface Change {
1748
+ current: string;
1749
+
1750
+ previous: string;
1751
+
1752
+ questionId: string;
1753
+ }
1754
+ }
1755
+ }
1756
+
1757
+ /**
1758
+ * A post without an analysis. It costs nothing.
1759
+ */
1760
+ export interface Unanalyzed {
1761
+ /**
1762
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
1763
+ */
1764
+ id: string;
1765
+
1766
+ /**
1767
+ * post_unavailable when X returns no such post. missing_text for a post without
1768
+ * text. insufficient_credits when credits ran out. context_limit when the settings
1769
+ * leave the post no room. The other reasons mean the analysis failed. Send the
1770
+ * post again.
1771
+ */
1772
+ reason: string;
1773
+
1774
+ status: 'failed' | 'skipped';
1775
+ }
1776
+ }
1777
+
1778
+ /**
1779
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
1780
+ * row in results costs 2 credits.
1781
+ */
1782
+ export interface AnalysisSentimentResponse {
1783
+ /**
1784
+ * Totals of the answers across the analyzed posts.
1785
+ */
1786
+ analysisSummary: AnalysisSentimentResponse.AnalysisSummary;
1787
+
1788
+ /**
1789
+ * Whether the search has more posts. Send next_cursor as cursor.
1790
+ */
1791
+ has_next_page: boolean;
1792
+
1793
+ /**
1794
+ * Cursor of the search's next page, else empty.
1795
+ */
1796
+ next_cursor: string;
1797
+
1798
+ /**
1799
+ * Each analyzed post with its answers.
1800
+ */
1801
+ results: Array<AnalysisSentimentResponse.Result>;
1802
+
1803
+ /**
1804
+ * Each post without an analysis, by ID & reason. These cost nothing.
1805
+ */
1806
+ unanalyzed: Array<AnalysisSentimentResponse.Unanalyzed>;
1807
+ }
1808
+
1809
+ export namespace AnalysisSentimentResponse {
1810
+ /**
1811
+ * Totals of the answers across the analyzed posts.
1812
+ */
1813
+ export interface AnalysisSummary {
1814
+ /**
1815
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
1816
+ * the market questions.
1817
+ */
1818
+ cashtags: Array<AnalysisSummary.Cashtag>;
1819
+
1820
+ /**
1821
+ * Likes, reposts, replies & quotes of the analyzed posts.
1822
+ */
1823
+ engagement: number;
1824
+
1825
+ /**
1826
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1827
+ * when the answer holds no post.
1828
+ */
1829
+ monitor: AnalysisSummary.Monitor | null;
1830
+
1831
+ /**
1832
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
1833
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
1834
+ * has mean, yes & no.
1835
+ */
1836
+ questions: { [key: string]: { [key: string]: unknown } };
1837
+
1838
+ /**
1839
+ * Posts by analysis outcome.
1840
+ */
1841
+ rows: AnalysisSummary.Rows;
1842
+
1843
+ schemaVersion: number;
1844
+
1845
+ /**
1846
+ * Posts per linked hostname, most posts first, up to 20.
1847
+ */
1848
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
1849
+
1850
+ /**
1851
+ * Mentions & answers per target in analysis.targets.
1852
+ */
1853
+ targets: Array<AnalysisSummary.Target>;
1854
+
1855
+ /**
1856
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
1857
+ * counts, the scores against actual engagement, a report per author & the
1858
+ * leaderboards.
1859
+ */
1860
+ viral?: { [key: string]: unknown };
1861
+ }
1862
+
1863
+ export namespace AnalysisSummary {
1864
+ export interface Cashtag {
1865
+ cashtag: string;
1866
+
1867
+ /**
1868
+ * Category counts of the cashtag's posts by question ID.
1869
+ */
1870
+ choices: { [key: string]: unknown };
1871
+
1872
+ rows: number;
1873
+
1874
+ signal?: Cashtag.Signal;
1875
+ }
1876
+
1877
+ export namespace Cashtag {
1878
+ export interface Signal {
1879
+ bearish: number;
1880
+
1881
+ bullish: number;
1882
+
1883
+ /**
1884
+ * Bullish minus bearish posts, over all posts.
1885
+ */
1886
+ score: number;
1887
+ }
1888
+ }
1889
+
1890
+ /**
1891
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
1892
+ * when the answer holds no post.
1893
+ */
1894
+ export interface Monitor {
1895
+ changedRows: Array<Monitor.ChangedRow>;
1896
+
1897
+ /**
1898
+ * Posts per monitor status.
1899
+ */
1900
+ statuses: { [key: string]: number };
1901
+ }
1902
+
1903
+ export namespace Monitor {
1904
+ export interface ChangedRow {
1905
+ changes: Array<ChangedRow.Change>;
1906
+
1907
+ tweetId: string;
1908
+ }
1909
+
1910
+ export namespace ChangedRow {
1911
+ export interface Change {
1912
+ current: string;
1913
+
1914
+ previous: string;
1915
+
1916
+ questionId: string;
1917
+ }
1918
+ }
1919
+ }
1920
+
1921
+ /**
1922
+ * Posts by analysis outcome.
1923
+ */
1924
+ export interface Rows {
1925
+ analyzed: number;
1926
+
1927
+ failed: number;
1928
+
1929
+ skipped: number;
1930
+ }
1931
+
1932
+ export interface SourceDomain {
1933
+ domain: string;
1934
+
1935
+ posts: number;
1936
+ }
1937
+
1938
+ export interface Target {
1939
+ /**
1940
+ * Category counts by question ID.
1941
+ */
1942
+ choices: { [key: string]: unknown };
1943
+
1944
+ engagement: number;
1945
+
1946
+ mentions: number;
1947
+
1948
+ name: string;
1949
+
1950
+ share: number;
1951
+
1952
+ /**
1953
+ * The most engaged posts per question ID & category.
1954
+ */
1955
+ top: { [key: string]: unknown };
1956
+ }
1957
+ }
1958
+
1959
+ /**
1960
+ * 1 analyzed post with its answers.
1961
+ */
1962
+ export interface Result {
1963
+ /**
1964
+ * The answers in full, with their probabilities.
1965
+ */
1966
+ analysis: Result.Analysis;
1967
+
1968
+ /**
1969
+ * Each question's decision by question ID. A choice gives its category, a score
1970
+ * its level from 0, which can have decimals, & a probability its value from 0 to
1971
+ * 1.
1972
+ */
1973
+ answers: { [key: string]: string | number };
1974
+
1975
+ /**
1976
+ * Cashtags in the post's text, in upper case.
1977
+ */
1978
+ cashtags: Array<string>;
1979
+
1980
+ /**
1981
+ * How the post's answers compare with its row in baseline, as the AI Actors
1982
+ * compare a run with an earlier dataset.
1983
+ */
1984
+ monitor: Result.Monitor;
1985
+
1986
+ /**
1987
+ * Hostnames the post links to, without t.co.
1988
+ */
1989
+ sourceDomains: Array<string>;
1990
+
1991
+ /**
1992
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
1993
+ * text:2 & so on.
1994
+ */
1995
+ tweet: Shared.SearchTweet;
1996
+
1997
+ /**
1998
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
1999
+ * that applied & the engagement comparison.
2000
+ */
2001
+ viral?: { [key: string]: unknown };
2002
+
2003
+ /**
2004
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
2005
+ * 1,000 followers. Null without a follower count.
2006
+ */
2007
+ viralActualEngagementRate?: number | null;
2008
+
2009
+ /**
2010
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
2011
+ * ranking weights, per 1,000 views or followers.
2012
+ */
2013
+ viralAlgorithmScore?: number | null;
2014
+
2015
+ /**
2016
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
2017
+ * trait has no answer.
2018
+ */
2019
+ viralScore?: number | null;
2020
+
2021
+ /**
2022
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
2023
+ * sleep_on_it.
2024
+ */
2025
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
2026
+ }
2027
+
2028
+ export namespace Result {
2029
+ /**
2030
+ * The answers in full, with their probabilities.
2031
+ */
2032
+ export interface Analysis {
2033
+ /**
2034
+ * 1 answer per question, in question order.
2035
+ */
2036
+ answers: Array<Analysis.Answer>;
2037
+
2038
+ /**
2039
+ * What the AI read beside the post's text.
2040
+ */
2041
+ contextAvailability: Analysis.ContextAvailability;
2042
+
2043
+ /**
2044
+ * Bytes of post & settings the AI read.
2045
+ */
2046
+ contextBytes: number;
2047
+
2048
+ /**
2049
+ * The ID & version of each question asked.
2050
+ */
2051
+ questions: Array<Analysis.Question>;
2052
+
2053
+ status: 'succeeded';
2054
+ }
2055
+
2056
+ export namespace Analysis {
2057
+ /**
2058
+ * 1 question's answer. A probability has probability. A choice or score has value,
2059
+ * confidence & the probability of each category or level.
2060
+ */
2061
+ export interface Answer {
2062
+ questionId: string;
2063
+
2064
+ questionVersion: string;
2065
+
2066
+ type: 'choice' | 'score' | 'probability';
2067
+
2068
+ confidence?: number;
2069
+
2070
+ /**
2071
+ * For a score. The levels the question named, from 0.
2072
+ */
2073
+ levels?: Array<string>;
2074
+
2075
+ /**
2076
+ * Probability of each category, or of each level by index.
2077
+ */
2078
+ probabilities?: { [key: string]: number };
2079
+
2080
+ /**
2081
+ * For a probability. The chance the answer is yes.
2082
+ */
2083
+ probability?: number;
2084
+
2085
+ /**
2086
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
2087
+ * between levels 1 & 2.
2088
+ */
2089
+ value?: string | number;
2090
+ }
2091
+
2092
+ /**
2093
+ * What the AI read beside the post's text.
2094
+ */
2095
+ export interface ContextAvailability {
2096
+ article: 'text_blocks' | 'summary' | 'not_supplied';
2097
+
2098
+ author: 'available' | 'missing';
2099
+
2100
+ media: 'text_descriptions_only' | 'not_supplied';
2101
+
2102
+ /**
2103
+ * truncated when the post was cut to fit.
2104
+ */
2105
+ postText: 'full' | 'truncated';
2106
+
2107
+ quote: 'available' | 'missing' | 'not_applicable';
2108
+
2109
+ reply: 'available' | 'missing' | 'not_applicable';
2110
+ }
2111
+
2112
+ export interface Question {
2113
+ id: string;
2114
+
2115
+ version: string;
2116
+ }
2117
+ }
2118
+
2119
+ /**
2120
+ * How the post's answers compare with its row in baseline, as the AI Actors
2121
+ * compare a run with an earlier dataset.
2122
+ */
2123
+ export interface Monitor {
2124
+ /**
2125
+ * Always null. The baseline is the rows you sent.
2126
+ */
2127
+ baselineDatasetId: null;
2128
+
2129
+ /**
2130
+ * IDs of the questions whose decision changed.
2131
+ */
2132
+ changedQuestionIds: Array<string>;
2133
+
2134
+ /**
2135
+ * Each changed decision, earlier & now.
2136
+ */
2137
+ changes: Array<Monitor.Change>;
2138
+
2139
+ /**
2140
+ * Hash of the questions, targets & context. Rows with another hash are
2141
+ * not_comparable.
2142
+ */
2143
+ configurationFingerprint: string;
2144
+
2145
+ /**
2146
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
2147
+ * when an answer clearly left its earlier decision. not_comparable when other
2148
+ * settings made the earlier row or it answers none of these questions.
2149
+ */
2150
+ status:
2151
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
2152
+ }
2153
+
2154
+ export namespace Monitor {
2155
+ export interface Change {
2156
+ current: string;
2157
+
2158
+ previous: string;
2159
+
2160
+ questionId: string;
2161
+ }
2162
+ }
2163
+ }
2164
+
2165
+ /**
2166
+ * A post without an analysis. It costs nothing.
2167
+ */
2168
+ export interface Unanalyzed {
2169
+ /**
2170
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
2171
+ */
2172
+ id: string;
2173
+
2174
+ /**
2175
+ * post_unavailable when X returns no such post. missing_text for a post without
2176
+ * text. insufficient_credits when credits ran out. context_limit when the settings
2177
+ * leave the post no room. The other reasons mean the analysis failed. Send the
2178
+ * post again.
2179
+ */
2180
+ reason: string;
2181
+
2182
+ status: 'failed' | 'skipped';
2183
+ }
2184
+ }
2185
+
2186
+ /**
2187
+ * Analyzed posts, the posts without an analysis & the totals of the answers. Each
2188
+ * row in results costs 2 credits.
2189
+ */
2190
+ export interface AnalysisViralScoreResponse {
2191
+ /**
2192
+ * Totals of the answers across the analyzed posts.
2193
+ */
2194
+ analysisSummary: AnalysisViralScoreResponse.AnalysisSummary;
2195
+
2196
+ /**
2197
+ * Whether the search has more posts. Send next_cursor as cursor.
2198
+ */
2199
+ has_next_page: boolean;
2200
+
2201
+ /**
2202
+ * Cursor of the search's next page, else empty.
2203
+ */
2204
+ next_cursor: string;
2205
+
2206
+ /**
2207
+ * Each analyzed post with its answers.
2208
+ */
2209
+ results: Array<AnalysisViralScoreResponse.Result>;
2210
+
2211
+ /**
2212
+ * Each post without an analysis, by ID & reason. These cost nothing.
2213
+ */
2214
+ unanalyzed: Array<AnalysisViralScoreResponse.Unanalyzed>;
2215
+ }
2216
+
2217
+ export namespace AnalysisViralScoreResponse {
2218
+ /**
2219
+ * Totals of the answers across the analyzed posts.
2220
+ */
2221
+ export interface AnalysisSummary {
2222
+ /**
2223
+ * Posts & answers per cashtag, most posts first, up to 20. signal is present for
2224
+ * the market questions.
2225
+ */
2226
+ cashtags: Array<AnalysisSummary.Cashtag>;
2227
+
2228
+ /**
2229
+ * Likes, reposts, replies & quotes of the analyzed posts.
2230
+ */
2231
+ engagement: number;
2232
+
2233
+ /**
2234
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
2235
+ * when the answer holds no post.
2236
+ */
2237
+ monitor: AnalysisSummary.Monitor | null;
2238
+
2239
+ /**
2240
+ * Totals by question ID. A choice has counts, shares, engagementShares & top posts
2241
+ * per category. A score has mean, engagementWeightedMean & levels. A probability
2242
+ * has mean, yes & no.
2243
+ */
2244
+ questions: { [key: string]: { [key: string]: unknown } };
2245
+
2246
+ /**
2247
+ * Posts by analysis outcome.
2248
+ */
2249
+ rows: AnalysisSummary.Rows;
2250
+
2251
+ schemaVersion: number;
2252
+
2253
+ /**
2254
+ * Posts per linked hostname, most posts first, up to 20.
2255
+ */
2256
+ sourceDomains: Array<AnalysisSummary.SourceDomain>;
2257
+
2258
+ /**
2259
+ * Mentions & answers per target in analysis.targets.
2260
+ */
2261
+ targets: Array<AnalysisSummary.Target>;
2262
+
2263
+ /**
2264
+ * Only from /x/analysis/viral-score. Scored posts, the average score, verdict
2265
+ * counts, the scores against actual engagement, a report per author & the
2266
+ * leaderboards.
2267
+ */
2268
+ viral?: { [key: string]: unknown };
2269
+ }
2270
+
2271
+ export namespace AnalysisSummary {
2272
+ export interface Cashtag {
2273
+ cashtag: string;
2274
+
2275
+ /**
2276
+ * Category counts of the cashtag's posts by question ID.
2277
+ */
2278
+ choices: { [key: string]: unknown };
2279
+
2280
+ rows: number;
2281
+
2282
+ signal?: Cashtag.Signal;
2283
+ }
2284
+
2285
+ export namespace Cashtag {
2286
+ export interface Signal {
2287
+ bearish: number;
2288
+
2289
+ bullish: number;
2290
+
2291
+ /**
2292
+ * Bullish minus bearish posts, over all posts.
2293
+ */
2294
+ score: number;
2295
+ }
2296
+ }
2297
+
2298
+ /**
2299
+ * Posts per comparison status, & up to 50 changed posts with their changes. Null
2300
+ * when the answer holds no post.
2301
+ */
2302
+ export interface Monitor {
2303
+ changedRows: Array<Monitor.ChangedRow>;
2304
+
2305
+ /**
2306
+ * Posts per monitor status.
2307
+ */
2308
+ statuses: { [key: string]: number };
2309
+ }
2310
+
2311
+ export namespace Monitor {
2312
+ export interface ChangedRow {
2313
+ changes: Array<ChangedRow.Change>;
2314
+
2315
+ tweetId: string;
2316
+ }
2317
+
2318
+ export namespace ChangedRow {
2319
+ export interface Change {
2320
+ current: string;
2321
+
2322
+ previous: string;
2323
+
2324
+ questionId: string;
2325
+ }
2326
+ }
2327
+ }
2328
+
2329
+ /**
2330
+ * Posts by analysis outcome.
2331
+ */
2332
+ export interface Rows {
2333
+ analyzed: number;
2334
+
2335
+ failed: number;
2336
+
2337
+ skipped: number;
2338
+ }
2339
+
2340
+ export interface SourceDomain {
2341
+ domain: string;
2342
+
2343
+ posts: number;
2344
+ }
2345
+
2346
+ export interface Target {
2347
+ /**
2348
+ * Category counts by question ID.
2349
+ */
2350
+ choices: { [key: string]: unknown };
2351
+
2352
+ engagement: number;
2353
+
2354
+ mentions: number;
2355
+
2356
+ name: string;
2357
+
2358
+ share: number;
2359
+
2360
+ /**
2361
+ * The most engaged posts per question ID & category.
2362
+ */
2363
+ top: { [key: string]: unknown };
2364
+ }
2365
+ }
2366
+
2367
+ /**
2368
+ * 1 analyzed post with its answers.
2369
+ */
2370
+ export interface Result {
2371
+ /**
2372
+ * The answers in full, with their probabilities.
2373
+ */
2374
+ analysis: Result.Analysis;
2375
+
2376
+ /**
2377
+ * Each question's decision by question ID. A choice gives its category, a score
2378
+ * its level from 0, which can have decimals, & a probability its value from 0 to
2379
+ * 1.
2380
+ */
2381
+ answers: { [key: string]: string | number };
2382
+
2383
+ /**
2384
+ * Cashtags in the post's text, in upper case.
2385
+ */
2386
+ cashtags: Array<string>;
2387
+
2388
+ /**
2389
+ * How the post's answers compare with its row in baseline, as the AI Actors
2390
+ * compare a run with an earlier dataset.
2391
+ */
2392
+ monitor: Result.Monitor;
2393
+
2394
+ /**
2395
+ * Hostnames the post links to, without t.co.
2396
+ */
2397
+ sourceDomains: Array<string>;
2398
+
2399
+ /**
2400
+ * The post, as /x/tweets/search returns it. Your own texts have the IDs text:1,
2401
+ * text:2 & so on.
2402
+ */
2403
+ tweet: Shared.SearchTweet;
2404
+
2405
+ /**
2406
+ * Only from /x/analysis/viral-score. The score with its weights version, the caps
2407
+ * that applied & the engagement comparison.
2408
+ */
2409
+ viral?: { [key: string]: unknown };
2410
+
2411
+ /**
2412
+ * Only from /x/analysis/viral-score. log10 of 1 plus the weighted engagement per
2413
+ * 1,000 followers. Null without a follower count.
2414
+ */
2415
+ viralActualEngagementRate?: number | null;
2416
+
2417
+ /**
2418
+ * Only from /x/analysis/viral-score. The post's public counts under X's published
2419
+ * ranking weights, per 1,000 views or followers.
2420
+ */
2421
+ viralAlgorithmScore?: number | null;
2422
+
2423
+ /**
2424
+ * Only from /x/analysis/viral-score. How viral the wording reads, or null when a
2425
+ * trait has no answer.
2426
+ */
2427
+ viralScore?: number | null;
2428
+
2429
+ /**
2430
+ * Only from /x/analysis/viral-score. send_it from 70, edit_first from 40, else
2431
+ * sleep_on_it.
2432
+ */
2433
+ viralVerdict?: 'send_it' | 'edit_first' | 'sleep_on_it' | null;
2434
+ }
2435
+
2436
+ export namespace Result {
2437
+ /**
2438
+ * The answers in full, with their probabilities.
2439
+ */
2440
+ export interface Analysis {
2441
+ /**
2442
+ * 1 answer per question, in question order.
2443
+ */
2444
+ answers: Array<Analysis.Answer>;
2445
+
2446
+ /**
2447
+ * What the AI read beside the post's text.
2448
+ */
2449
+ contextAvailability: Analysis.ContextAvailability;
2450
+
2451
+ /**
2452
+ * Bytes of post & settings the AI read.
2453
+ */
2454
+ contextBytes: number;
2455
+
2456
+ /**
2457
+ * The ID & version of each question asked.
2458
+ */
2459
+ questions: Array<Analysis.Question>;
2460
+
2461
+ status: 'succeeded';
2462
+ }
2463
+
2464
+ export namespace Analysis {
2465
+ /**
2466
+ * 1 question's answer. A probability has probability. A choice or score has value,
2467
+ * confidence & the probability of each category or level.
2468
+ */
2469
+ export interface Answer {
2470
+ questionId: string;
2471
+
2472
+ questionVersion: string;
2473
+
2474
+ type: 'choice' | 'score' | 'probability';
2475
+
2476
+ confidence?: number;
2477
+
2478
+ /**
2479
+ * For a score. The levels the question named, from 0.
2480
+ */
2481
+ levels?: Array<string>;
2482
+
2483
+ /**
2484
+ * Probability of each category, or of each level by index.
2485
+ */
2486
+ probabilities?: { [key: string]: number };
2487
+
2488
+ /**
2489
+ * For a probability. The chance the answer is yes.
2490
+ */
2491
+ probability?: number;
2492
+
2493
+ /**
2494
+ * The chosen category, or the level from 0, which can have decimals, such as 1.4
2495
+ * between levels 1 & 2.
2496
+ */
2497
+ value?: string | number;
2498
+ }
2499
+
2500
+ /**
2501
+ * What the AI read beside the post's text.
2502
+ */
2503
+ export interface ContextAvailability {
2504
+ article: 'text_blocks' | 'summary' | 'not_supplied';
2505
+
2506
+ author: 'available' | 'missing';
2507
+
2508
+ media: 'text_descriptions_only' | 'not_supplied';
2509
+
2510
+ /**
2511
+ * truncated when the post was cut to fit.
2512
+ */
2513
+ postText: 'full' | 'truncated';
2514
+
2515
+ quote: 'available' | 'missing' | 'not_applicable';
2516
+
2517
+ reply: 'available' | 'missing' | 'not_applicable';
2518
+ }
2519
+
2520
+ export interface Question {
2521
+ id: string;
2522
+
2523
+ version: string;
2524
+ }
2525
+ }
2526
+
2527
+ /**
2528
+ * How the post's answers compare with its row in baseline, as the AI Actors
2529
+ * compare a run with an earlier dataset.
2530
+ */
2531
+ export interface Monitor {
2532
+ /**
2533
+ * Always null. The baseline is the rows you sent.
2534
+ */
2535
+ baselineDatasetId: null;
2536
+
2537
+ /**
2538
+ * IDs of the questions whose decision changed.
2539
+ */
2540
+ changedQuestionIds: Array<string>;
2541
+
2542
+ /**
2543
+ * Each changed decision, earlier & now.
2544
+ */
2545
+ changes: Array<Monitor.Change>;
2546
+
2547
+ /**
2548
+ * Hash of the questions, targets & context. Rows with another hash are
2549
+ * not_comparable.
2550
+ */
2551
+ configurationFingerprint: string;
2552
+
2553
+ /**
2554
+ * first_run without baseline. new_to_baseline for a post baseline lacks. changed
2555
+ * when an answer clearly left its earlier decision. not_comparable when other
2556
+ * settings made the earlier row or it answers none of these questions.
2557
+ */
2558
+ status:
2559
+ 'first_run' | 'new_to_baseline' | 'unchanged' | 'changed' | 'not_comparable' | 'analysis_unavailable';
2560
+ }
2561
+
2562
+ export namespace Monitor {
2563
+ export interface Change {
2564
+ current: string;
2565
+
2566
+ previous: string;
2567
+
2568
+ questionId: string;
2569
+ }
2570
+ }
2571
+ }
2572
+
2573
+ /**
2574
+ * A post without an analysis. It costs nothing.
2575
+ */
2576
+ export interface Unanalyzed {
2577
+ /**
2578
+ * Post ID. Your own texts have the IDs text:1, text:2 & so on.
2579
+ */
2580
+ id: string;
2581
+
2582
+ /**
2583
+ * post_unavailable when X returns no such post. missing_text for a post without
2584
+ * text. insufficient_credits when credits ran out. context_limit when the settings
2585
+ * leave the post no room. The other reasons mean the analysis failed. Send the
2586
+ * post again.
2587
+ */
2588
+ reason: string;
2589
+
2590
+ status: 'failed' | 'skipped';
2591
+ }
2592
+ }
2593
+
2594
+ export interface AnalysisBrandParams {
2595
+ /**
2596
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
2597
+ * out for the route's own questions.
2598
+ */
2599
+ analysis?: AnalysisBrandParams.Analysis;
2600
+
2601
+ /**
2602
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
2603
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
2604
+ * as not_comparable. Each result's monitor says whether the post is new, changed
2605
+ * or unchanged. The comparison costs nothing extra.
2606
+ */
2607
+ baseline?: Array<AnalysisBrandParams.Baseline>;
2608
+
2609
+ /**
2610
+ * The next_cursor of the page before. Send the same search with it.
2611
+ */
2612
+ cursor?: string;
2613
+
2614
+ /**
2615
+ * Maximum posts to analyze from the search. Credits can return fewer.
2616
+ */
2617
+ limit?: number;
2618
+
2619
+ /**
2620
+ * Analyze a public List's posts. Send its ID or URL.
2621
+ */
2622
+ listId?: string;
2623
+
2624
+ /**
2625
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
2626
+ * or lang:en. X searches up to 512 characters, counted with the other search
2627
+ * fields, as /x/tweets/search counts q.
2628
+ */
2629
+ query?: string;
2630
+
2631
+ /**
2632
+ * Search order. Default Latest.
2633
+ */
2634
+ queryType?: 'Latest' | 'Top';
2635
+
2636
+ /**
2637
+ * Analyze the quotes of 1 post. Send its ID or URL.
2638
+ */
2639
+ quotesOf?: string;
2640
+
2641
+ /**
2642
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
2643
+ */
2644
+ repliesTo?: string;
2645
+
2646
+ /**
2647
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
2648
+ * work. A time without an offset is UTC.
2649
+ */
2650
+ sinceTime?: string | number;
2651
+
2652
+ /**
2653
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
2654
+ * the same as 1 analyzed post.
2655
+ */
2656
+ texts?: Array<string>;
2657
+
2658
+ /**
2659
+ * Post IDs or post URLs to analyze, up to 100.
2660
+ */
2661
+ tweetIds?: Array<string>;
2662
+
2663
+ /**
2664
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
2665
+ * work. A time without an offset is UTC.
2666
+ */
2667
+ untilTime?: string | number;
2668
+
2669
+ /**
2670
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
2671
+ */
2672
+ username?: string;
2673
+ }
2674
+
2675
+ export namespace AnalysisBrandParams {
2676
+ /**
2677
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
2678
+ * out for the route's own questions.
2679
+ */
2680
+ export interface Analysis {
2681
+ /**
2682
+ * Posts analyzed at the same time.
2683
+ */
2684
+ concurrency?: number;
2685
+
2686
+ /**
2687
+ * Background the AI reads with every post.
2688
+ */
2689
+ context?: string;
2690
+
2691
+ /**
2692
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
2693
+ * settings take 219 bytes, so a smaller value gets a 400.
2694
+ */
2695
+ maxContextBytes?: number;
2696
+
2697
+ /**
2698
+ * A ready set of questions, used when questions is left out. complaints,
2699
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
2700
+ * how viral the wording reads.
2701
+ */
2702
+ preset?:
2703
+ | 'brand'
2704
+ | 'complaints'
2705
+ | 'competitors'
2706
+ | 'purchase_intent'
2707
+ | 'product_feedback'
2708
+ | 'news'
2709
+ | 'sentiment'
2710
+ | 'market'
2711
+ | 'viral_lite';
2712
+
2713
+ /**
2714
+ * Your own questions, which replace the route's questions. Write question IDs &
2715
+ * category names in lower case without hyphens.
2716
+ */
2717
+ questions?: Array<Analysis.Question>;
2718
+
2719
+ /**
2720
+ * Brands, people, assets or topics the questions are about, each with its aliases.
2721
+ */
2722
+ targets?: Array<Analysis.Target>;
2723
+ }
2724
+
2725
+ export namespace Analysis {
2726
+ /**
2727
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
2728
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
2729
+ * yes or no.
2730
+ */
2731
+ export interface Question {
2732
+ /**
2733
+ * Name of the answer, such as request. A name the response renames or drops gets a
2734
+ * 400, such as created_at, favorite_count, muting or blocking.
2735
+ */
2736
+ id: string;
2737
+
2738
+ /**
2739
+ * The question, as the AI reads it.
2740
+ */
2741
+ instructions: string;
2742
+
2743
+ type: 'choice' | 'score' | 'probability';
2744
+
2745
+ /**
2746
+ * Your version of the question, such as 1.
2747
+ */
2748
+ version: string;
2749
+
2750
+ /**
2751
+ * For a choice. Each category name with its description, or null.
2752
+ */
2753
+ categories?: { [key: string]: string | null };
2754
+
2755
+ /**
2756
+ * For a probability. What counts as yes & as no.
2757
+ */
2758
+ criteria?: Question.Criteria;
2759
+
2760
+ /**
2761
+ * For a score. Each level's description, lowest first.
2762
+ */
2763
+ levels?: Array<string>;
2764
+ }
2765
+
2766
+ export namespace Question {
2767
+ /**
2768
+ * For a probability. What counts as yes & as no.
2769
+ */
2770
+ export interface Criteria {
2771
+ no: string;
2772
+
2773
+ yes: string;
2774
+ }
2775
+ }
2776
+
2777
+ export interface Target {
2778
+ name: string;
2779
+
2780
+ aliases?: Array<string>;
2781
+ }
2782
+ }
2783
+
2784
+ export interface Baseline {
2785
+ /**
2786
+ * The earlier answers by question ID.
2787
+ */
2788
+ answers: { [key: string]: string | number };
2789
+
2790
+ /**
2791
+ * Post ID, or text:1 & so on. Else tweet.id counts.
2792
+ */
2793
+ id?: string;
2794
+
2795
+ /**
2796
+ * The earlier row's monitor, with its fingerprint.
2797
+ */
2798
+ monitor?: Baseline.Monitor;
2799
+
2800
+ tweet?: Baseline.Tweet;
2801
+ }
2802
+
2803
+ export namespace Baseline {
2804
+ /**
2805
+ * The earlier row's monitor, with its fingerprint.
2806
+ */
2807
+ export interface Monitor {
2808
+ configurationFingerprint?: string;
2809
+ }
2810
+
2811
+ export interface Tweet {
2812
+ id: string;
2813
+ }
2814
+ }
2815
+ }
2816
+
2817
+ export interface AnalysisClassifyParams {
2818
+ /**
2819
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
2820
+ * out for the route's own questions.
2821
+ */
2822
+ analysis?: AnalysisClassifyParams.Analysis;
2823
+
2824
+ /**
2825
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
2826
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
2827
+ * as not_comparable. Each result's monitor says whether the post is new, changed
2828
+ * or unchanged. The comparison costs nothing extra.
2829
+ */
2830
+ baseline?: Array<AnalysisClassifyParams.Baseline>;
2831
+
2832
+ /**
2833
+ * The next_cursor of the page before. Send the same search with it.
2834
+ */
2835
+ cursor?: string;
2836
+
2837
+ /**
2838
+ * Maximum posts to analyze from the search. Credits can return fewer.
2839
+ */
2840
+ limit?: number;
2841
+
2842
+ /**
2843
+ * Analyze a public List's posts. Send its ID or URL.
2844
+ */
2845
+ listId?: string;
2846
+
2847
+ /**
2848
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
2849
+ * or lang:en. X searches up to 512 characters, counted with the other search
2850
+ * fields, as /x/tweets/search counts q.
2851
+ */
2852
+ query?: string;
2853
+
2854
+ /**
2855
+ * Search order. Default Latest.
2856
+ */
2857
+ queryType?: 'Latest' | 'Top';
2858
+
2859
+ /**
2860
+ * Analyze the quotes of 1 post. Send its ID or URL.
2861
+ */
2862
+ quotesOf?: string;
2863
+
2864
+ /**
2865
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
2866
+ */
2867
+ repliesTo?: string;
2868
+
2869
+ /**
2870
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
2871
+ * work. A time without an offset is UTC.
2872
+ */
2873
+ sinceTime?: string | number;
2874
+
2875
+ /**
2876
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
2877
+ * the same as 1 analyzed post.
2878
+ */
2879
+ texts?: Array<string>;
2880
+
2881
+ /**
2882
+ * Post IDs or post URLs to analyze, up to 100.
2883
+ */
2884
+ tweetIds?: Array<string>;
2885
+
2886
+ /**
2887
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
2888
+ * work. A time without an offset is UTC.
2889
+ */
2890
+ untilTime?: string | number;
2891
+
2892
+ /**
2893
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
2894
+ */
2895
+ username?: string;
2896
+ }
2897
+
2898
+ export namespace AnalysisClassifyParams {
2899
+ /**
2900
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
2901
+ * out for the route's own questions.
2902
+ */
2903
+ export interface Analysis {
2904
+ /**
2905
+ * Posts analyzed at the same time.
2906
+ */
2907
+ concurrency?: number;
2908
+
2909
+ /**
2910
+ * Background the AI reads with every post.
2911
+ */
2912
+ context?: string;
2913
+
2914
+ /**
2915
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
2916
+ * settings take 219 bytes, so a smaller value gets a 400.
2917
+ */
2918
+ maxContextBytes?: number;
2919
+
2920
+ /**
2921
+ * A ready set of questions, used when questions is left out. complaints,
2922
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
2923
+ * how viral the wording reads.
2924
+ */
2925
+ preset?:
2926
+ | 'brand'
2927
+ | 'complaints'
2928
+ | 'competitors'
2929
+ | 'purchase_intent'
2930
+ | 'product_feedback'
2931
+ | 'news'
2932
+ | 'sentiment'
2933
+ | 'market'
2934
+ | 'viral_lite';
2935
+
2936
+ /**
2937
+ * Your own questions, which replace the route's questions. Write question IDs &
2938
+ * category names in lower case without hyphens.
2939
+ */
2940
+ questions?: Array<Analysis.Question>;
2941
+
2942
+ /**
2943
+ * Brands, people, assets or topics the questions are about, each with its aliases.
2944
+ */
2945
+ targets?: Array<Analysis.Target>;
2946
+ }
2947
+
2948
+ export namespace Analysis {
2949
+ /**
2950
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
2951
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
2952
+ * yes or no.
2953
+ */
2954
+ export interface Question {
2955
+ /**
2956
+ * Name of the answer, such as request. A name the response renames or drops gets a
2957
+ * 400, such as created_at, favorite_count, muting or blocking.
2958
+ */
2959
+ id: string;
2960
+
2961
+ /**
2962
+ * The question, as the AI reads it.
2963
+ */
2964
+ instructions: string;
2965
+
2966
+ type: 'choice' | 'score' | 'probability';
2967
+
2968
+ /**
2969
+ * Your version of the question, such as 1.
2970
+ */
2971
+ version: string;
2972
+
2973
+ /**
2974
+ * For a choice. Each category name with its description, or null.
2975
+ */
2976
+ categories?: { [key: string]: string | null };
2977
+
2978
+ /**
2979
+ * For a probability. What counts as yes & as no.
2980
+ */
2981
+ criteria?: Question.Criteria;
2982
+
2983
+ /**
2984
+ * For a score. Each level's description, lowest first.
2985
+ */
2986
+ levels?: Array<string>;
2987
+ }
2988
+
2989
+ export namespace Question {
2990
+ /**
2991
+ * For a probability. What counts as yes & as no.
2992
+ */
2993
+ export interface Criteria {
2994
+ no: string;
2995
+
2996
+ yes: string;
2997
+ }
2998
+ }
2999
+
3000
+ export interface Target {
3001
+ name: string;
3002
+
3003
+ aliases?: Array<string>;
3004
+ }
3005
+ }
3006
+
3007
+ export interface Baseline {
3008
+ /**
3009
+ * The earlier answers by question ID.
3010
+ */
3011
+ answers: { [key: string]: string | number };
3012
+
3013
+ /**
3014
+ * Post ID, or text:1 & so on. Else tweet.id counts.
3015
+ */
3016
+ id?: string;
3017
+
3018
+ /**
3019
+ * The earlier row's monitor, with its fingerprint.
3020
+ */
3021
+ monitor?: Baseline.Monitor;
3022
+
3023
+ tweet?: Baseline.Tweet;
3024
+ }
3025
+
3026
+ export namespace Baseline {
3027
+ /**
3028
+ * The earlier row's monitor, with its fingerprint.
3029
+ */
3030
+ export interface Monitor {
3031
+ configurationFingerprint?: string;
3032
+ }
3033
+
3034
+ export interface Tweet {
3035
+ id: string;
3036
+ }
3037
+ }
3038
+ }
3039
+
3040
+ export interface AnalysisMarketSignalsParams {
3041
+ /**
3042
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3043
+ * out for the route's own questions.
3044
+ */
3045
+ analysis?: AnalysisMarketSignalsParams.Analysis;
3046
+
3047
+ /**
3048
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
3049
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
3050
+ * as not_comparable. Each result's monitor says whether the post is new, changed
3051
+ * or unchanged. The comparison costs nothing extra.
3052
+ */
3053
+ baseline?: Array<AnalysisMarketSignalsParams.Baseline>;
3054
+
3055
+ /**
3056
+ * The next_cursor of the page before. Send the same search with it.
3057
+ */
3058
+ cursor?: string;
3059
+
3060
+ /**
3061
+ * Maximum posts to analyze from the search. Credits can return fewer.
3062
+ */
3063
+ limit?: number;
3064
+
3065
+ /**
3066
+ * Analyze a public List's posts. Send its ID or URL.
3067
+ */
3068
+ listId?: string;
3069
+
3070
+ /**
3071
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
3072
+ * or lang:en. X searches up to 512 characters, counted with the other search
3073
+ * fields, as /x/tweets/search counts q.
3074
+ */
3075
+ query?: string;
3076
+
3077
+ /**
3078
+ * Search order. Default Latest.
3079
+ */
3080
+ queryType?: 'Latest' | 'Top';
3081
+
3082
+ /**
3083
+ * Analyze the quotes of 1 post. Send its ID or URL.
3084
+ */
3085
+ quotesOf?: string;
3086
+
3087
+ /**
3088
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
3089
+ */
3090
+ repliesTo?: string;
3091
+
3092
+ /**
3093
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
3094
+ * work. A time without an offset is UTC.
3095
+ */
3096
+ sinceTime?: string | number;
3097
+
3098
+ /**
3099
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
3100
+ * the same as 1 analyzed post.
3101
+ */
3102
+ texts?: Array<string>;
3103
+
3104
+ /**
3105
+ * Post IDs or post URLs to analyze, up to 100.
3106
+ */
3107
+ tweetIds?: Array<string>;
3108
+
3109
+ /**
3110
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
3111
+ * work. A time without an offset is UTC.
3112
+ */
3113
+ untilTime?: string | number;
3114
+
3115
+ /**
3116
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
3117
+ */
3118
+ username?: string;
3119
+ }
3120
+
3121
+ export namespace AnalysisMarketSignalsParams {
3122
+ /**
3123
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3124
+ * out for the route's own questions.
3125
+ */
3126
+ export interface Analysis {
3127
+ /**
3128
+ * Posts analyzed at the same time.
3129
+ */
3130
+ concurrency?: number;
3131
+
3132
+ /**
3133
+ * Background the AI reads with every post.
3134
+ */
3135
+ context?: string;
3136
+
3137
+ /**
3138
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
3139
+ * settings take 219 bytes, so a smaller value gets a 400.
3140
+ */
3141
+ maxContextBytes?: number;
3142
+
3143
+ /**
3144
+ * A ready set of questions, used when questions is left out. complaints,
3145
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
3146
+ * how viral the wording reads.
3147
+ */
3148
+ preset?:
3149
+ | 'brand'
3150
+ | 'complaints'
3151
+ | 'competitors'
3152
+ | 'purchase_intent'
3153
+ | 'product_feedback'
3154
+ | 'news'
3155
+ | 'sentiment'
3156
+ | 'market'
3157
+ | 'viral_lite';
3158
+
3159
+ /**
3160
+ * Your own questions, which replace the route's questions. Write question IDs &
3161
+ * category names in lower case without hyphens.
3162
+ */
3163
+ questions?: Array<Analysis.Question>;
3164
+
3165
+ /**
3166
+ * Brands, people, assets or topics the questions are about, each with its aliases.
3167
+ */
3168
+ targets?: Array<Analysis.Target>;
3169
+ }
3170
+
3171
+ export namespace Analysis {
3172
+ /**
3173
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
3174
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
3175
+ * yes or no.
3176
+ */
3177
+ export interface Question {
3178
+ /**
3179
+ * Name of the answer, such as request. A name the response renames or drops gets a
3180
+ * 400, such as created_at, favorite_count, muting or blocking.
3181
+ */
3182
+ id: string;
3183
+
3184
+ /**
3185
+ * The question, as the AI reads it.
3186
+ */
3187
+ instructions: string;
3188
+
3189
+ type: 'choice' | 'score' | 'probability';
3190
+
3191
+ /**
3192
+ * Your version of the question, such as 1.
3193
+ */
3194
+ version: string;
3195
+
3196
+ /**
3197
+ * For a choice. Each category name with its description, or null.
3198
+ */
3199
+ categories?: { [key: string]: string | null };
3200
+
3201
+ /**
3202
+ * For a probability. What counts as yes & as no.
3203
+ */
3204
+ criteria?: Question.Criteria;
3205
+
3206
+ /**
3207
+ * For a score. Each level's description, lowest first.
3208
+ */
3209
+ levels?: Array<string>;
3210
+ }
3211
+
3212
+ export namespace Question {
3213
+ /**
3214
+ * For a probability. What counts as yes & as no.
3215
+ */
3216
+ export interface Criteria {
3217
+ no: string;
3218
+
3219
+ yes: string;
3220
+ }
3221
+ }
3222
+
3223
+ export interface Target {
3224
+ name: string;
3225
+
3226
+ aliases?: Array<string>;
3227
+ }
3228
+ }
3229
+
3230
+ export interface Baseline {
3231
+ /**
3232
+ * The earlier answers by question ID.
3233
+ */
3234
+ answers: { [key: string]: string | number };
3235
+
3236
+ /**
3237
+ * Post ID, or text:1 & so on. Else tweet.id counts.
3238
+ */
3239
+ id?: string;
3240
+
3241
+ /**
3242
+ * The earlier row's monitor, with its fingerprint.
3243
+ */
3244
+ monitor?: Baseline.Monitor;
3245
+
3246
+ tweet?: Baseline.Tweet;
3247
+ }
3248
+
3249
+ export namespace Baseline {
3250
+ /**
3251
+ * The earlier row's monitor, with its fingerprint.
3252
+ */
3253
+ export interface Monitor {
3254
+ configurationFingerprint?: string;
3255
+ }
3256
+
3257
+ export interface Tweet {
3258
+ id: string;
3259
+ }
3260
+ }
3261
+ }
3262
+
3263
+ export interface AnalysisNewsParams {
3264
+ /**
3265
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3266
+ * out for the route's own questions.
3267
+ */
3268
+ analysis?: AnalysisNewsParams.Analysis;
3269
+
3270
+ /**
3271
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
3272
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
3273
+ * as not_comparable. Each result's monitor says whether the post is new, changed
3274
+ * or unchanged. The comparison costs nothing extra.
3275
+ */
3276
+ baseline?: Array<AnalysisNewsParams.Baseline>;
3277
+
3278
+ /**
3279
+ * The next_cursor of the page before. Send the same search with it.
3280
+ */
3281
+ cursor?: string;
3282
+
3283
+ /**
3284
+ * Maximum posts to analyze from the search. Credits can return fewer.
3285
+ */
3286
+ limit?: number;
3287
+
3288
+ /**
3289
+ * Analyze a public List's posts. Send its ID or URL.
3290
+ */
3291
+ listId?: string;
3292
+
3293
+ /**
3294
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
3295
+ * or lang:en. X searches up to 512 characters, counted with the other search
3296
+ * fields, as /x/tweets/search counts q.
3297
+ */
3298
+ query?: string;
3299
+
3300
+ /**
3301
+ * Search order. Default Latest.
3302
+ */
3303
+ queryType?: 'Latest' | 'Top';
3304
+
3305
+ /**
3306
+ * Analyze the quotes of 1 post. Send its ID or URL.
3307
+ */
3308
+ quotesOf?: string;
3309
+
3310
+ /**
3311
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
3312
+ */
3313
+ repliesTo?: string;
3314
+
3315
+ /**
3316
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
3317
+ * work. A time without an offset is UTC.
3318
+ */
3319
+ sinceTime?: string | number;
3320
+
3321
+ /**
3322
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
3323
+ * the same as 1 analyzed post.
3324
+ */
3325
+ texts?: Array<string>;
3326
+
3327
+ /**
3328
+ * Post IDs or post URLs to analyze, up to 100.
3329
+ */
3330
+ tweetIds?: Array<string>;
3331
+
3332
+ /**
3333
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
3334
+ * work. A time without an offset is UTC.
3335
+ */
3336
+ untilTime?: string | number;
3337
+
3338
+ /**
3339
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
3340
+ */
3341
+ username?: string;
3342
+ }
3343
+
3344
+ export namespace AnalysisNewsParams {
3345
+ /**
3346
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3347
+ * out for the route's own questions.
3348
+ */
3349
+ export interface Analysis {
3350
+ /**
3351
+ * Posts analyzed at the same time.
3352
+ */
3353
+ concurrency?: number;
3354
+
3355
+ /**
3356
+ * Background the AI reads with every post.
3357
+ */
3358
+ context?: string;
3359
+
3360
+ /**
3361
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
3362
+ * settings take 219 bytes, so a smaller value gets a 400.
3363
+ */
3364
+ maxContextBytes?: number;
3365
+
3366
+ /**
3367
+ * A ready set of questions, used when questions is left out. complaints,
3368
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
3369
+ * how viral the wording reads.
3370
+ */
3371
+ preset?:
3372
+ | 'brand'
3373
+ | 'complaints'
3374
+ | 'competitors'
3375
+ | 'purchase_intent'
3376
+ | 'product_feedback'
3377
+ | 'news'
3378
+ | 'sentiment'
3379
+ | 'market'
3380
+ | 'viral_lite';
3381
+
3382
+ /**
3383
+ * Your own questions, which replace the route's questions. Write question IDs &
3384
+ * category names in lower case without hyphens.
3385
+ */
3386
+ questions?: Array<Analysis.Question>;
3387
+
3388
+ /**
3389
+ * Brands, people, assets or topics the questions are about, each with its aliases.
3390
+ */
3391
+ targets?: Array<Analysis.Target>;
3392
+ }
3393
+
3394
+ export namespace Analysis {
3395
+ /**
3396
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
3397
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
3398
+ * yes or no.
3399
+ */
3400
+ export interface Question {
3401
+ /**
3402
+ * Name of the answer, such as request. A name the response renames or drops gets a
3403
+ * 400, such as created_at, favorite_count, muting or blocking.
3404
+ */
3405
+ id: string;
3406
+
3407
+ /**
3408
+ * The question, as the AI reads it.
3409
+ */
3410
+ instructions: string;
3411
+
3412
+ type: 'choice' | 'score' | 'probability';
3413
+
3414
+ /**
3415
+ * Your version of the question, such as 1.
3416
+ */
3417
+ version: string;
3418
+
3419
+ /**
3420
+ * For a choice. Each category name with its description, or null.
3421
+ */
3422
+ categories?: { [key: string]: string | null };
3423
+
3424
+ /**
3425
+ * For a probability. What counts as yes & as no.
3426
+ */
3427
+ criteria?: Question.Criteria;
3428
+
3429
+ /**
3430
+ * For a score. Each level's description, lowest first.
3431
+ */
3432
+ levels?: Array<string>;
3433
+ }
3434
+
3435
+ export namespace Question {
3436
+ /**
3437
+ * For a probability. What counts as yes & as no.
3438
+ */
3439
+ export interface Criteria {
3440
+ no: string;
3441
+
3442
+ yes: string;
3443
+ }
3444
+ }
3445
+
3446
+ export interface Target {
3447
+ name: string;
3448
+
3449
+ aliases?: Array<string>;
3450
+ }
3451
+ }
3452
+
3453
+ export interface Baseline {
3454
+ /**
3455
+ * The earlier answers by question ID.
3456
+ */
3457
+ answers: { [key: string]: string | number };
3458
+
3459
+ /**
3460
+ * Post ID, or text:1 & so on. Else tweet.id counts.
3461
+ */
3462
+ id?: string;
3463
+
3464
+ /**
3465
+ * The earlier row's monitor, with its fingerprint.
3466
+ */
3467
+ monitor?: Baseline.Monitor;
3468
+
3469
+ tweet?: Baseline.Tweet;
3470
+ }
3471
+
3472
+ export namespace Baseline {
3473
+ /**
3474
+ * The earlier row's monitor, with its fingerprint.
3475
+ */
3476
+ export interface Monitor {
3477
+ configurationFingerprint?: string;
3478
+ }
3479
+
3480
+ export interface Tweet {
3481
+ id: string;
3482
+ }
3483
+ }
3484
+ }
3485
+
3486
+ export interface AnalysisSentimentParams {
3487
+ /**
3488
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3489
+ * out for the route's own questions.
3490
+ */
3491
+ analysis?: AnalysisSentimentParams.Analysis;
3492
+
3493
+ /**
3494
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
3495
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
3496
+ * as not_comparable. Each result's monitor says whether the post is new, changed
3497
+ * or unchanged. The comparison costs nothing extra.
3498
+ */
3499
+ baseline?: Array<AnalysisSentimentParams.Baseline>;
3500
+
3501
+ /**
3502
+ * The next_cursor of the page before. Send the same search with it.
3503
+ */
3504
+ cursor?: string;
3505
+
3506
+ /**
3507
+ * Maximum posts to analyze from the search. Credits can return fewer.
3508
+ */
3509
+ limit?: number;
3510
+
3511
+ /**
3512
+ * Analyze a public List's posts. Send its ID or URL.
3513
+ */
3514
+ listId?: string;
3515
+
3516
+ /**
3517
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
3518
+ * or lang:en. X searches up to 512 characters, counted with the other search
3519
+ * fields, as /x/tweets/search counts q.
3520
+ */
3521
+ query?: string;
3522
+
3523
+ /**
3524
+ * Search order. Default Latest.
3525
+ */
3526
+ queryType?: 'Latest' | 'Top';
3527
+
3528
+ /**
3529
+ * Analyze the quotes of 1 post. Send its ID or URL.
3530
+ */
3531
+ quotesOf?: string;
3532
+
3533
+ /**
3534
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
3535
+ */
3536
+ repliesTo?: string;
3537
+
3538
+ /**
3539
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
3540
+ * work. A time without an offset is UTC.
3541
+ */
3542
+ sinceTime?: string | number;
3543
+
3544
+ /**
3545
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
3546
+ * the same as 1 analyzed post.
3547
+ */
3548
+ texts?: Array<string>;
3549
+
3550
+ /**
3551
+ * Post IDs or post URLs to analyze, up to 100.
3552
+ */
3553
+ tweetIds?: Array<string>;
3554
+
3555
+ /**
3556
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
3557
+ * work. A time without an offset is UTC.
3558
+ */
3559
+ untilTime?: string | number;
3560
+
3561
+ /**
3562
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
3563
+ */
3564
+ username?: string;
3565
+ }
3566
+
3567
+ export namespace AnalysisSentimentParams {
3568
+ /**
3569
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3570
+ * out for the route's own questions.
3571
+ */
3572
+ export interface Analysis {
3573
+ /**
3574
+ * Posts analyzed at the same time.
3575
+ */
3576
+ concurrency?: number;
3577
+
3578
+ /**
3579
+ * Background the AI reads with every post.
3580
+ */
3581
+ context?: string;
3582
+
3583
+ /**
3584
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
3585
+ * settings take 219 bytes, so a smaller value gets a 400.
3586
+ */
3587
+ maxContextBytes?: number;
3588
+
3589
+ /**
3590
+ * A ready set of questions, used when questions is left out. complaints,
3591
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
3592
+ * how viral the wording reads.
3593
+ */
3594
+ preset?:
3595
+ | 'brand'
3596
+ | 'complaints'
3597
+ | 'competitors'
3598
+ | 'purchase_intent'
3599
+ | 'product_feedback'
3600
+ | 'news'
3601
+ | 'sentiment'
3602
+ | 'market'
3603
+ | 'viral_lite';
3604
+
3605
+ /**
3606
+ * Your own questions, which replace the route's questions. Write question IDs &
3607
+ * category names in lower case without hyphens.
3608
+ */
3609
+ questions?: Array<Analysis.Question>;
3610
+
3611
+ /**
3612
+ * Brands, people, assets or topics the questions are about, each with its aliases.
3613
+ */
3614
+ targets?: Array<Analysis.Target>;
3615
+ }
3616
+
3617
+ export namespace Analysis {
3618
+ /**
3619
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
3620
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
3621
+ * yes or no.
3622
+ */
3623
+ export interface Question {
3624
+ /**
3625
+ * Name of the answer, such as request. A name the response renames or drops gets a
3626
+ * 400, such as created_at, favorite_count, muting or blocking.
3627
+ */
3628
+ id: string;
3629
+
3630
+ /**
3631
+ * The question, as the AI reads it.
3632
+ */
3633
+ instructions: string;
3634
+
3635
+ type: 'choice' | 'score' | 'probability';
3636
+
3637
+ /**
3638
+ * Your version of the question, such as 1.
3639
+ */
3640
+ version: string;
3641
+
3642
+ /**
3643
+ * For a choice. Each category name with its description, or null.
3644
+ */
3645
+ categories?: { [key: string]: string | null };
3646
+
3647
+ /**
3648
+ * For a probability. What counts as yes & as no.
3649
+ */
3650
+ criteria?: Question.Criteria;
3651
+
3652
+ /**
3653
+ * For a score. Each level's description, lowest first.
3654
+ */
3655
+ levels?: Array<string>;
3656
+ }
3657
+
3658
+ export namespace Question {
3659
+ /**
3660
+ * For a probability. What counts as yes & as no.
3661
+ */
3662
+ export interface Criteria {
3663
+ no: string;
3664
+
3665
+ yes: string;
3666
+ }
3667
+ }
3668
+
3669
+ export interface Target {
3670
+ name: string;
3671
+
3672
+ aliases?: Array<string>;
3673
+ }
3674
+ }
3675
+
3676
+ export interface Baseline {
3677
+ /**
3678
+ * The earlier answers by question ID.
3679
+ */
3680
+ answers: { [key: string]: string | number };
3681
+
3682
+ /**
3683
+ * Post ID, or text:1 & so on. Else tweet.id counts.
3684
+ */
3685
+ id?: string;
3686
+
3687
+ /**
3688
+ * The earlier row's monitor, with its fingerprint.
3689
+ */
3690
+ monitor?: Baseline.Monitor;
3691
+
3692
+ tweet?: Baseline.Tweet;
3693
+ }
3694
+
3695
+ export namespace Baseline {
3696
+ /**
3697
+ * The earlier row's monitor, with its fingerprint.
3698
+ */
3699
+ export interface Monitor {
3700
+ configurationFingerprint?: string;
3701
+ }
3702
+
3703
+ export interface Tweet {
3704
+ id: string;
3705
+ }
3706
+ }
3707
+ }
3708
+
3709
+ export interface AnalysisViralScoreParams {
3710
+ /**
3711
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3712
+ * out for the route's own questions.
3713
+ */
3714
+ analysis?: AnalysisViralScoreParams.Analysis;
3715
+
3716
+ /**
3717
+ * Rows of an earlier answer to compare with, such as its results. Each needs the
3718
+ * post's id, or tweet.id, & its answers. Send monitor too, so other settings show
3719
+ * as not_comparable. Each result's monitor says whether the post is new, changed
3720
+ * or unchanged. The comparison costs nothing extra.
3721
+ */
3722
+ baseline?: Array<AnalysisViralScoreParams.Baseline>;
3723
+
3724
+ /**
3725
+ * The next_cursor of the page before. Send the same search with it.
3726
+ */
3727
+ cursor?: string;
3728
+
3729
+ /**
3730
+ * Maximum posts to analyze from the search. Credits can return fewer.
3731
+ */
3732
+ limit?: number;
3733
+
3734
+ /**
3735
+ * Analyze a public List's posts. Send its ID or URL.
3736
+ */
3737
+ listId?: string;
3738
+
3739
+ /**
3740
+ * X search to analyze, with the operators of /x/tweets/search, such as from:nasa
3741
+ * or lang:en. X searches up to 512 characters, counted with the other search
3742
+ * fields, as /x/tweets/search counts q.
3743
+ */
3744
+ query?: string;
3745
+
3746
+ /**
3747
+ * Search order. Default Latest.
3748
+ */
3749
+ queryType?: 'Latest' | 'Top';
3750
+
3751
+ /**
3752
+ * Analyze the quotes of 1 post. Send its ID or URL.
3753
+ */
3754
+ quotesOf?: string;
3755
+
3756
+ /**
3757
+ * Analyze the replies in 1 post's conversation. Send its ID or URL.
3758
+ */
3759
+ repliesTo?: string;
3760
+
3761
+ /**
3762
+ * Inclusive start of the search, such as 2026-09-25T00:00:00Z. Unix seconds also
3763
+ * work. A time without an offset is UTC.
3764
+ */
3765
+ sinceTime?: string | number;
3766
+
3767
+ /**
3768
+ * Your own texts to analyze, such as drafts. Reads nothing from X. Each text costs
3769
+ * the same as 1 analyzed post.
3770
+ */
3771
+ texts?: Array<string>;
3772
+
3773
+ /**
3774
+ * Post IDs or post URLs to analyze, up to 100.
3775
+ */
3776
+ tweetIds?: Array<string>;
3777
+
3778
+ /**
3779
+ * Exclusive end of the search, such as 2026-09-26T00:00:00Z. Unix seconds also
3780
+ * work. A time without an offset is UTC.
3781
+ */
3782
+ untilTime?: string | number;
3783
+
3784
+ /**
3785
+ * Analyze 1 account's posts. Send a handle, with or without @, or a profile URL.
3786
+ */
3787
+ username?: string;
3788
+ }
3789
+
3790
+ export namespace AnalysisViralScoreParams {
3791
+ /**
3792
+ * Analysis settings, the same as the analysis input of Xquik's AI Actors. Leave it
3793
+ * out for the route's own questions.
3794
+ */
3795
+ export interface Analysis {
3796
+ /**
3797
+ * Posts analyzed at the same time.
3798
+ */
3799
+ concurrency?: number;
3800
+
3801
+ /**
3802
+ * Background the AI reads with every post.
3803
+ */
3804
+ context?: string;
3805
+
3806
+ /**
3807
+ * Bytes of post, quote & settings the AI reads. Longer posts are cut to fit. Empty
3808
+ * settings take 219 bytes, so a smaller value gets a 400.
3809
+ */
3810
+ maxContextBytes?: number;
3811
+
3812
+ /**
3813
+ * A ready set of questions, used when questions is left out. complaints,
3814
+ * competitors, purchase_intent & product_feedback need targets. viral_lite scores
3815
+ * how viral the wording reads.
3816
+ */
3817
+ preset?:
3818
+ | 'brand'
3819
+ | 'complaints'
3820
+ | 'competitors'
3821
+ | 'purchase_intent'
3822
+ | 'product_feedback'
3823
+ | 'news'
3824
+ | 'sentiment'
3825
+ | 'market'
3826
+ | 'viral_lite';
3827
+
3828
+ /**
3829
+ * Your own questions, which replace the route's questions. Write question IDs &
3830
+ * category names in lower case without hyphens.
3831
+ */
3832
+ questions?: Array<Analysis.Question>;
3833
+
3834
+ /**
3835
+ * Brands, people, assets or topics the questions are about, each with its aliases.
3836
+ */
3837
+ targets?: Array<Analysis.Target>;
3838
+ }
3839
+
3840
+ export namespace Analysis {
3841
+ /**
3842
+ * A question the AI answers for each post. A choice picks 1 of 2 to 255
3843
+ * categories, a score picks 1 of 2 or more ordered levels & a probability answers
3844
+ * yes or no.
3845
+ */
3846
+ export interface Question {
3847
+ /**
3848
+ * Name of the answer, such as request. A name the response renames or drops gets a
3849
+ * 400, such as created_at, favorite_count, muting or blocking.
3850
+ */
3851
+ id: string;
3852
+
3853
+ /**
3854
+ * The question, as the AI reads it.
3855
+ */
3856
+ instructions: string;
3857
+
3858
+ type: 'choice' | 'score' | 'probability';
3859
+
3860
+ /**
3861
+ * Your version of the question, such as 1.
3862
+ */
3863
+ version: string;
3864
+
3865
+ /**
3866
+ * For a choice. Each category name with its description, or null.
3867
+ */
3868
+ categories?: { [key: string]: string | null };
3869
+
3870
+ /**
3871
+ * For a probability. What counts as yes & as no.
3872
+ */
3873
+ criteria?: Question.Criteria;
3874
+
3875
+ /**
3876
+ * For a score. Each level's description, lowest first.
3877
+ */
3878
+ levels?: Array<string>;
3879
+ }
3880
+
3881
+ export namespace Question {
3882
+ /**
3883
+ * For a probability. What counts as yes & as no.
3884
+ */
3885
+ export interface Criteria {
3886
+ no: string;
3887
+
3888
+ yes: string;
3889
+ }
3890
+ }
3891
+
3892
+ export interface Target {
3893
+ name: string;
3894
+
3895
+ aliases?: Array<string>;
3896
+ }
3897
+ }
3898
+
3899
+ export interface Baseline {
3900
+ /**
3901
+ * The earlier answers by question ID.
3902
+ */
3903
+ answers: { [key: string]: string | number };
3904
+
3905
+ /**
3906
+ * Post ID, or text:1 & so on. Else tweet.id counts.
3907
+ */
3908
+ id?: string;
3909
+
3910
+ /**
3911
+ * The earlier row's monitor, with its fingerprint.
3912
+ */
3913
+ monitor?: Baseline.Monitor;
3914
+
3915
+ tweet?: Baseline.Tweet;
3916
+ }
3917
+
3918
+ export namespace Baseline {
3919
+ /**
3920
+ * The earlier row's monitor, with its fingerprint.
3921
+ */
3922
+ export interface Monitor {
3923
+ configurationFingerprint?: string;
3924
+ }
3925
+
3926
+ export interface Tweet {
3927
+ id: string;
3928
+ }
3929
+ }
3930
+ }
3931
+
3932
+ export declare namespace Analysis {
3933
+ export {
3934
+ type AnalysisBrandResponse as AnalysisBrandResponse,
3935
+ type AnalysisClassifyResponse as AnalysisClassifyResponse,
3936
+ type AnalysisMarketSignalsResponse as AnalysisMarketSignalsResponse,
3937
+ type AnalysisNewsResponse as AnalysisNewsResponse,
3938
+ type AnalysisSentimentResponse as AnalysisSentimentResponse,
3939
+ type AnalysisViralScoreResponse as AnalysisViralScoreResponse,
3940
+ type AnalysisBrandParams as AnalysisBrandParams,
3941
+ type AnalysisClassifyParams as AnalysisClassifyParams,
3942
+ type AnalysisMarketSignalsParams as AnalysisMarketSignalsParams,
3943
+ type AnalysisNewsParams as AnalysisNewsParams,
3944
+ type AnalysisSentimentParams as AnalysisSentimentParams,
3945
+ type AnalysisViralScoreParams as AnalysisViralScoreParams,
3946
+ };
3947
+ }