@socq/core
v0.1.8
Published
Catalog-driven client for the SocQ Agent API
Readme
@socq/core
Catalog-driven JavaScript client for the SocQ Agent API. Endpoint schemas are loaded from the hosted Capability Registry instead of being duplicated in this package.
Install
npm install @socq/coreNode.js 20 or newer is required.
Usage
import {SocqClient} from "@socq/core";
const client = new SocqClient({apiKey: process.env.SOCQ_API_KEY});
const capability = await client.capability("youtube/videos");
const task = await client.submit("youtube", "videos", {
urls: ["https://www.youtube.com/watch?v=VIDEO_ID"],
});
const completed = await client.waitTask(task.task_id);
// Fixed, provider-independent result fields with an optional projection.
const standard = await client.waitTask(task.task_id, {
view: "standard",
fields: ["id", "url", "author.username"],
});
const downloaded = await client.downloadFiles(task.task_id, "./socq-results");Set SOCQ_BASE_URL or pass baseUrl to target another SocQ environment. The default is https://api.socq.ai.
See the SocQ website.
License
MIT
