Syncing Content
Learn how to sync your website content to RankVectors
Overview
Syncing content is the first step in using RankVectors. You can sync pages via:
- REST API: Manual or programmatic sync
- SDKs: Language-specific libraries
- Integrations: WordPress, Shopify, Vercel, etc.
- Webhooks: Automatic sync on content updates
Manual Sync
Single Page
await client.pages.sync(projectId, {
url: 'https://example.com/page',
content: 'Full page HTML or text content',
title: 'Page Title',
statusCode: 200,
metadata: {
headings: ['H1', 'H2', 'H3'],
links: ['/about', '/contact']
}
})
Batch Sync
Sync multiple pages efficiently:
await client.pages.batchSync(projectId, [
{
url: 'https://example.com/page1',
content: 'Content 1',
title: 'Page 1'
},
{
url: 'https://example.com/page2',
content: 'Content 2',
title: 'Page 2'
}
])
Automatic Sync
Webhooks
Configure webhooks to automatically sync content when it changes:
// Webhook endpoint receives POST requests
app.post('/webhook/rankvectors', async (req, res) => {
const { url, content, title } = req.body
await client.pages.sync(projectId, {
url,
content,
title
})
res.status(200).json({ success: true })
})
Scheduled Sync
Set up scheduled syncs using cron jobs or task queues:
// Sync all pages daily
setInterval(async () => {
const pages = await fetchAllPages()
for (const page of pages) {
await client.pages.sync(projectId, {
url: page.url,
content: page.content,
title: page.title
})
}
}, 24 * 60 * 60 * 1000) // 24 hours
Content Format
RankVectors works best with structured content:
HTML Content
{
url: 'https://example.com/page',
content: '<html>...</html>', // Full HTML
contentType: 'text/html'
}
Text Content
{
url: 'https://example.com/page',
content: 'Plain text content...',
contentType: 'text/plain'
}
With Metadata
{
url: 'https://example.com/page',
content: 'Content...',
title: 'Page Title',
description: 'Meta description',
statusCode: 200,
metadata: {
headings: ['Main Heading', 'Subheading'],
links: ['/page1', '/page2'],
publishedAt: '2024-01-01T00:00:00Z'
}
}
Sync Filters
Control which pages get synced using filters:
await client.projects.update(projectId, {
includePaths: ['/blog', '/docs'], // Only sync these paths
excludePaths: ['/admin', '/private'], // Exclude these paths
statusCodes: [200] // Only sync successful pages
})
Best Practices
ℹ️
Sync only public, indexable content for best results.
- Sync regularly: Keep content up-to-date with regular syncs
- Include metadata: Headings, links, and descriptions improve suggestions
- Filter wisely: Exclude admin pages and private content
- Monitor sync status: Check the dashboard for sync errors
- Batch operations: Use batch sync for multiple pages