//native
/**
* Get research task
* Retrieve a Linkup research task by id, with its status and, once completed, its output.
*/
export async function main(auth: RT.Linkup, research_id: string) {
const url = new URL(
`https://api.linkup.so/v1/research/${encodeURIComponent(research_id)}`
)
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 3 hours ago