SDK
Install and configure the official ArticlesQ TypeScript SDK to interact with your articles programmatically.
Installation
npm install @articlesq/sdkSetup
import ArticlesQ from "@articlesq/sdk";
const articlesq = new ArticlesQ({
apiKey: process.env.ARTICLESQ_API_KEY!,
});
export default articlesq;The API key is scoped to a single project — all SDK calls operate on that project's articles automatically.
Usage
List articles
const { data, error } = await articlesq.articles.list({ page: 1, limit: 20 });
if (data) {
for (const article of data.articles) {
console.log(article.title, article.slug);
}
}Get a single article
const { data, error } = await articlesq.articles.get("best-crm-for-startups");
if (data) {
console.log(data.article.content); // full markdown body
}Create an article
const { data, error } = await articlesq.articles.create({
title: "10 Link Building Strategies That Actually Work",
keyword: "link building strategies",
content: "# Introduction\n\nYour markdown here...",
});
if (error) {
// 409 = slug conflict, 400 = validation error
console.error(error);
}Update an article
const { data, error } = await articlesq.articles.update("link-building-strategies", {
metaDescription: "Learn proven link building strategies to boost your DA.",
});Send only the fields you want to change — title, slug (draft only), content, or metaDescription.
Configuration
| Option | Default | Description |
|---|---|---|
apiKey | — | Your aq_live_... key from Settings → Integrations & API |
Error handling
Every method returns { data, error }. On failure, data is undefined and error contains the status code and problem-details body:
const { data, error } = await articlesq.articles.get("nonexistent-slug");
if (error) {
console.error(error.status); // 404
console.error(error.detail); // "Article not found"
}OpenAPI
The SDK is auto-generated from the OpenAPI spec. You can use it directly with any OpenAPI-compatible tool or code generator for other languages.
Next steps
- Quick Start — create a project and generate an API key
- API Reference — full endpoint docs with request/response schemas