Skip to content

RankVectors/php-sdk

Repository files navigation

rankvectors/rankvectors

Intelligent internal linking optimization API using AI.

RankVectors helps you automatically discover and implement optimal internal links across your website to improve SEO performance and user experience.

Key Features

  • AI-Powered Analysis: Uses OpenAI embeddings to find optimal linking opportunities
  • Smart Crawling: Automatically crawls and analyzes your website content
  • Automated Implementation: Implement links via webhooks or manual instructions
  • Page-Based Plans: Predictable pricing by number of pages monitored
  • Multi-Platform Support: Works with any CMS or platform via REST API

Getting Started

  1. Create a project with your website URL
  2. Start a crawl to analyze your content
  3. Generate AI-powered link suggestions
  4. Implement suggestions via API or webhook
  5. Track performance and manage page usage and limits

Authentication

Most API endpoints support authentication using your RankVectors API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API key from your RankVectors dashboard: Settings → API Keys

Note: Some endpoints (marked in the documentation) support both API key authentication and web session authentication (Stack Auth). API key authentication is required for SDK usage and external integrations like WordPress plugins.

For more information, please visit https://rankvectors.com/docs.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/rankvectors/rankvectors-php-sdk.git"
    }
  ],
  "require": {
    "rankvectors/rankvectors-php-sdk": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/rankvectors/rankvectors/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: ApiKeyAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\APIKeysApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$create_api_key_request = new \OpenAPI\Client\Model\CreateApiKeyRequest(); // \OpenAPI\Client\Model\CreateApiKeyRequest

try {
    $result = $apiInstance->createApiKey($create_api_key_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.rankvectors.com

Class Method HTTP request Description
APIKeysApi createApiKey POST /api/api-keys Create API key
APIKeysApi deleteApiKey DELETE /api/api-keys/{id} Delete API key
APIKeysApi listApiKeys GET /api/api-keys List API keys
APIKeysApi updateApiKey PATCH /api/api-keys/{id} Update API key
AnalyticsApi getProjectAnalytics GET /api/projects/{projectId}/analytics Get project analytics
ContentVerificationApi getPageChanges GET /api/projects/{projectId}/changes Get page changes
ContentVerificationApi verifyContent POST /api/projects/{projectId}/verify-content Verify page content
CrawlingApi getCrawlHistory GET /api/projects/{projectId}/crawl Get crawl history
CrawlingApi startCrawl POST /api/projects/{projectId}/crawl Start website crawl
ImplementationsApi getImplementation GET /api/projects/{projectId}/implementations/{implementationId} Get implementation details
ImplementationsApi implementLinks POST /api/projects/{projectId}/implementations Implement link suggestions
ImplementationsApi listImplementations GET /api/projects/{projectId}/implementations List implementations
ImplementationsApi rollbackImplementation POST /api/projects/{projectId}/implementations/{implementationId}/rollback Rollback implementation
PagesApi batchSyncPages POST /api/projects/{projectId}/pages/batch Batch sync pages
PagesApi listPages GET /api/projects/{projectId}/pages List pages
ProjectsApi createProject POST /api/projects Create a new project
ProjectsApi deleteProject DELETE /api/projects/{projectId} Delete a project
ProjectsApi getProject GET /api/projects/{projectId} Get project details
ProjectsApi listProjects GET /api/projects List all projects
ProjectsApi syncProject POST /api/projects/{projectId}/sync Sync project
SuggestionsApi deleteSuggestion DELETE /api/projects/{projectId}/suggestions/{suggestionId} Delete suggestion
SuggestionsApi generateSuggestions POST /api/projects/{projectId}/suggestions Generate link suggestions
SuggestionsApi getSuggestions GET /api/projects/{projectId}/suggestions Get link suggestions
SuggestionsApi updateSuggestion PATCH /api/projects/{projectId}/suggestions/{suggestionId} Update suggestion status
UserApi getUserInfo GET /api/user/me Get authenticated user information
WebhooksApi getImplementationInstructions GET /api/webhook/implement-link Get implementation instructions
WebhooksApi reportImplementationStatus POST /api/webhook/implement-link Report implementation status

Models

Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

tj@rankvectors.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.3.1
    • Generator version: 7.16.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors