Custom Integration
Build your own RankVectors integration
Overview
Build a custom integration using the RankVectors REST API or SDKs for any platform or CMS.
Using the REST API
Authentication
Include your API key in all requests:
Authorization: Bearer YOUR_API_KEY
Sync Content
curl -X POST https://api.rankvectors.com/api/projects/{projectId}/pages/batch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"url": "https://example.com/page1",
"content": "Content...",
"title": "Page 1"
}
]'
Generate Suggestions
curl -X POST https://api.rankvectors.com/api/projects/{projectId}/suggestions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourcePageUrl": "https://example.com/page",
"limit": 10
}'
Using SDKs
JavaScript/TypeScript
import { RankVectors } from '@rankvectors/rankvectors-javascript'
const client = new RankVectors({
apiKey: 'YOUR_API_KEY'
})
// Sync content
await client.pages.sync(projectId, {
url: 'https://example.com/page',
content: 'Content...'
})
Python
from rankvectors import RankVectors
client = RankVectors(api_key="YOUR_API_KEY")
# Sync content
client.pages.sync(project_id, {
"url": "https://example.com/page",
"content": "Content..."
})
Webhooks
Set up webhooks to sync content automatically:
// Your webhook endpoint
app.post('/webhook/rankvectors', async (req, res) => {
const { url, content, title } = req.body
// Sync to RankVectors
await client.pages.sync(projectId, {
url,
content,
title
})
res.json({ success: true })
})
Implementation
Implement links programmatically:
// Get suggestions
const suggestions = await client.suggestions.list(projectId)
// Implement links in your CMS
for (const suggestion of suggestions) {
await updatePage(suggestion.sourcePageUrl, {
content: addLink(content, suggestion)
})
// Mark as implemented
await client.suggestions.update(projectId, suggestion.id, {
status: 'implemented'
})
}
Best Practices
ℹ️
Use batch endpoints for multiple pages to reduce API calls.
- Batch operations: Use batch sync for multiple pages
- Error handling: Implement retry logic for failed requests
- Rate limiting: Respect API rate limits
- Webhooks: Use webhooks for real-time updates
- Caching: Cache content when appropriate
Example Integrations
Headless CMS
// Sync content from headless CMS
async function syncFromCMS(projectId) {
const pages = await fetchPagesFromCMS()
await client.pages.batchSync(projectId, pages.map(page => ({
url: page.url,
content: page.content,
title: page.title
})))
}
Custom CMS
// Custom CMS integration
class CustomCMSIntegration {
constructor(apiKey, projectId) {
this.client = new RankVectors({ apiKey })
this.projectId = projectId
}
async sync(page) {
return this.client.pages.sync(this.projectId, {
url: page.url,
content: page.content,
title: page.title
})
}
async getSuggestions(sourceUrl) {
return this.client.suggestions.generate(this.projectId, {
sourcePageUrl: sourceUrl,
limit: 10
})
}
}
Support
For help building custom integrations, contact support at support@rankvectors.com.