export type GetApiGetxlast3Args = {handle: string}; export type GetApiGetxlast3Options = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Latest X (Twitter) posts: returns the three most recent posts from a handle, with the full text and date of each. For social monitoring, brand tracking, news alerts, and AI agents that need current posts. * * GET /getxlast3 */ export const getApiGetxlast3 = async (args: GetApiGetxlast3Args, options?: GetApiGetxlast3Options) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.handle != null) query.append("handle", String(args.handle)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getxlast3${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };