moreseo
v1.0.5
Published
Client library for the MoreSEO API
Downloads
28
Readme
MoreSEO Blog API Client library
Overview
Elevate your website by integrating MoreSEO's Blog API. This setup allows you to fetch and render real-time, SEO-optimized blog content directly into your website.
Demo
Visit the MoreSEO Blog to check out an example of MoreSEO Blog API integration.
Checkout Next.js integration example at moreseo-nextjs-blog repository.
Prerequisites
MoreSEO API Key - you can find the API key in settings on dashboard of MoreSEO
Features
- Fetch published articles by page and limit.
- Retrieve articles based on categories or tags.
- Access detailed information about a specific article.
- Built-in caching mechanism for efficient data retrieval.
Installation
To install the moreseo npm package, run:
npm install moreseoUsage
import { BlogClient } from 'moreseo';
const client = new BlogClient('your_moreseo_api_key_here');Fetching Articles
// Note: page parameter is zero-based (1 = first page, 2 = second page, etc.)
const articles = await client.getArticles(page, limit);Fetching Articles by Category
// Note: page parameter is zero-based (1 = first page, 2 = second page, etc.)
const articles = await client.getCategoryArticles(categorySlug, page, limit);Fetching Articles by Tag
// Note: page parameter is zero-based (1 = first page, 2 = second page, etc.)
const articles = await client.getTagArticles(tagSlug, page, limit);Getting a Single Article
const article = await client.getArticle(slug);Data Types
export interface IArticle {
_id: string;
tags: ITag[]; // act as metaKeywords also
title: string;
category: ICategory;
featuredImage: string;
slug: string;
html: string;
published: boolean;
relatedPosts: IRelatedPost[];
metaDescription: string;
createdAt: Date;
updatedAt: Date;
}
interface ITag {
title: string;
slug: string;
}
interface ICategory {
title: string;
slug: string;
}
interface IRelatedPost {
title: string;
slug: string;
}Contributing
Contributions are welcome. Please open an issue or submit a pull request for any bugs, features, or improvements.
License
This project is licensed under the MIT License.
Contact
For additional assistance or information, feel free to reach out.
Revolutionize your website's content strategy with real-time, automated, SEO-optimized blog posts. Get started with MoreSEO AI Blog Autopilot integration today!
