API endpoints overview
RankAI provides two essential API endpoints for integrating content:- Articles list endpoint: Fetch a paginated list of all your published articles.
- Single article endpoint: Fetch a specific article by its slug with customizable format (HTML or Markdown).
Endpoint 1: Get articles list
Use this endpoint to retrieve a paginated list of all your published articles with summary information.API URL
Parameters
- projectId: Your unique project identifier (replace {projectId} in the URL).
- page: Page number for pagination (optional, defaults to 1).
- limit: Number of articles per page (optional, defaults to 10, max 100).
Response format
Example usage
Endpoint 2: Get single article
Use this endpoint to fetch a specific article by its slug with full content in your preferred format.API URL
Parameters
- projectId: Your unique project identifier (replace {projectId} in the URL).
- slug: The article’s URL slug (replace {slug} in the URL).
- format: Content format — “html” or “markdown” (optional, defaults to “html”).
- publishedUrl: The full URL where this article is published on your site (required for tracking).
Response format
Example usage
Next.js implementation example
Article list component
Single article component
Best practices
- Pass published URL: Always include the publishedUrl parameter so we can track where your articles are published. This enables better analytics and indexing tracking.
- Implement caching: Cache API responses to reduce load times and API calls (e.g. use Next.js
revalidate). - Error handling: Always check the “success” field in responses and handle errors gracefully.
- Pagination: Use the pagination data to implement proper pagination controls.
Troubleshooting
Common issues
- Invalid format error: Ensure the format parameter is either “html” or “markdown”.
- Article not found: Verify the slug exists and the article is published.
Install the technical SEO & AEO script
The article API above supplies content for your website to display. Follow the separate illustrated technical SEO & AEO setup to install the RankAI script.Last reviewed: October 12, 2026.