# Introduction

You can interact with our API through simple HTTP requests from any language. Our API is currently available on this endpoint:

<pre><code><strong>https://api.ranklytics.ai/
</strong></code></pre>

### Generate your API Keys

To generate your API Keys go to "API" from the top right menu and click "Add New".

Add a "Name" to identify your API internally and click Add.

You can generate as many API keys you like and can toggle off inactive ones to avoid abuse.&#x20;

To reveal the secret key, press the eye icon.

<figure><img src="https://2159717180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIK2Xe43B40I2n67LqlDe%2Fuploads%2F2ctnfaV5vkn612s7PIdw%2FScreenshot%202024-09-16%20at%205.55.03%E2%80%AFPM.png?alt=media&amp;token=8dc61cfa-a882-4241-b43b-991c7d4c276c" alt=""><figcaption></figcaption></figure>

### Rate Limits

All accounts will default to a maximum of 100 calls per 24 hours. It's a rolling 24-hour window. If you go above 100 calls, you'll receive a 429 status code with the error - "You have exceeded your rate limit".

If you need more than 100 calls a day, please reach out to our support at <support@ranklytics.ai>


# Authentication

Ranklytics API uses API Key & Secret Key for authentication. You can create API keys at the account level from "API" link within your top right menu.&#x20;

**Remember that your API Key & Secret Key is a secret!** Do not share it with others or expose it with any client-side code (Browsers, Apps). Production request must be routed through your own backend server where your API & Secret Key can be securely loaded from an environment variable.

All API requests should include the API Key & Secret key in the HTTP Header as follows:

```
X-API-KEY: your_api_key_here
X-SECRET-KEY: your_secret_key_here
```

Example curl command

```bash
curl -X GET https://api.ranklytics.ai/ \
  -H "X-API-KEY: your_api_key_here" \
  -H "X-SECRET-KEY: your_secret_key_here" \
  -H "Content-Type: application/json"

```


# Get Projects

Get all projects within your account

## GET /projects

> Get Projects

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Projects","description":"Projects"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/projects":{"get":{"tags":["Projects"],"summary":"Get Projects","operationId":"e705b82a79a5740b0af91f6fa07fc76c","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"projects":{"type":"array","items":{"properties":{"id":{"type":"integer"},"business_name":{"type":"string"},"description":{"type":"string"},"website":{"type":"string"},"category":{"type":"string"},"language":{"type":"string"},"location":{"type":"string"},"created_on":{"type":"string","format":"date"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Get Keywords

Get all tracked keywords within your project along with their search volume and competition index.

## GET /keywords

> Get Tracked Keywords

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Keywords","description":"Keywords"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/keywords":{"get":{"tags":["Keywords"],"summary":"Get Tracked Keywords","operationId":"02bdf1deaca669f09f417ee292b4daca","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"keywords":{"type":"array","items":{"properties":{"id":{"type":"integer"},"project_id":{"type":"integer"},"seed_keyword":{"type":"string"},"keyword":{"type":"string"},"search_volume":{"type":"string"},"competition_index":{"type":"number"},"rank":{"type":"integer"},"last_updated_on":{"type":"string","format":"date"},"last_rank_checked":{"type":"string","format":"date"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Get Content

Get all the content within your project with full details.

## GET /content

> Get Content

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Content","description":"Content"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/content":{"get":{"tags":["Content"],"summary":"Get Content","operationId":"d265369cf4f2bf2e26a2f89574ba9cbb","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"content":{"type":"array","items":{"properties":{"id":{"type":"integer"},"project_id":{"type":"integer"},"topic":{"type":"string"},"title":{"type":"string"},"style":{"type":"string"},"keyword":{"type":"string"},"content":{"type":"string"},"featured_image":{"type":"string"},"last_updated_on":{"type":"string","format":"date"},"mode":{"type":"string"},"status":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Get Rankings

Get a full ranking report of all keywords you currently rank for.

## GET /rankings

> Get Rankings

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Rankings","description":"Rankings"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/rankings":{"get":{"tags":["Rankings"],"summary":"Get Rankings","operationId":"9ea16518e5a0920eca0f0939a3e03747","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"rankings":{"type":"array","items":{"properties":{"id":{"type":"integer"},"project_id":{"type":"integer"},"domain":{"type":"string"},"location":{"type":"string"},"rank":{"type":"integer"},"keyword":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"check_url":{"type":"string"},"last_updated_on":{"type":"string","format":"date"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Find Keywords

Find keyword ideas based on a seed keyword

## POST /findKeywords

> Find Keywords

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Keywords","description":"Keywords"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/findKeywords":{"post":{"tags":["Keywords"],"summary":"Find Keywords","operationId":"3cee6e97e6303d8a3285950d9bc45dfd","parameters":[{"name":"offset","in":"query","description":"Number of results to skip","schema":{"type":"integer","default":0}},{"name":"limit","in":"query","description":"Maximum number of results to return","schema":{"type":"integer","default":100,"maximum":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project ID","type":"integer"},"keyword":{"description":"Seed keyword to find variations for","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"offset":{"description":"Number of results skipped","type":"integer"},"limit":{"description":"Maximum number of results returned","type":"integer"},"keywords":{"type":"array","items":{"properties":{"keyword":{"description":"The keyword","type":"string"},"competition":{"description":"Competition level","type":"string"},"competition_index":{"description":"Competition index score","type":"number"},"search_volume":{"description":"Monthly search volume","type":"string"},"difficulty":{"description":"Keyword difficulty score","type":"string"},"in_account":{"description":"Whether keyword is already tracked (1) or not (0)","type":"integer"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Find Content Ideas

Find content ideas based on a keyword

## POST /findContentIdeas

> Find Content Ideas

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Content","description":"Content"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/findContentIdeas":{"post":{"tags":["Content"],"summary":"Find Content Ideas","operationId":"e3903637fd2fc1d7397da5e0cf9e97ee","parameters":[{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project ID","type":"integer"},"keyword":{"description":"Keyword to find content ideas for","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"offset":{"description":"Number of results skipped","type":"integer"},"limit":{"description":"Maximum number of results returned","type":"integer"},"ideas":{"type":"array","items":{"properties":{"topic":{"description":"Content topic suggestion","type":"string"},"in_account":{"description":"Whether topic is already in account (1) or not (0)","type":"integer"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials or Project not found","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Get OnPage Report

Get all pages and their corresponding onpage report

## GET /pages

> Get all Page Reports

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Pages","description":"Pages"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/pages":{"get":{"tags":["Pages"],"summary":"Get all Page Reports","operationId":"f6ce51ee7b7df5736f149e3bdd133c0c","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"offset":{"type":"integer"},"limit":{"type":"integer"},"pages":{"type":"array","items":{"properties":{"title":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"internal_links":{"type":"integer"},"external_links":{"type":"integer"},"images":{"type":"integer"},"render_blocking_scripts_count":{"type":"integer"},"word_count":{"type":"integer"},"readability_index":{"type":"number"},"last_modified_header":{"type":"string","format":"date-time"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Invalid API Credentials or Project not found","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Add Keyword to Project

Add a keyword to your project and start tracking

## POST /addKeyword

> Add a new keyword

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Keywords","description":"Keywords"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/addKeyword":{"post":{"tags":["Keywords"],"summary":"Add a new keyword","operationId":"572c15678c200ddc127a78999e6d69e0","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"type":"integer"},"keyword":{"type":"string"},"seed_keyword":{"type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"400":{"description":"Invalid API Credentials, Project not found, or Keyword already exists","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


# Add a Content Idea

Add a content idea to your project and schedule it for article generation

## POST /addContentIdea

> Add a new content idea

```json
{"openapi":"3.0.0","info":{"title":"Ranklytics API","version":"1.0.0"},"tags":[{"name":"Content","description":"Content"}],"servers":[{"url":"https://api.ranklytics.ai","description":"Ranklytics API Server"}],"security":[{"apiKey":[],"secretKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"API Key for authentication","name":"X-API-KEY","in":"header"}}},"paths":{"/addContentIdea":{"post":{"tags":["Content"],"summary":"Add a new content idea","operationId":"67df26ca47292b29259fcfe4bf4efbc3","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"type":"integer"},"topic":{"type":"string"},"keyword":{"type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"},"id":{"type":"integer"}},"type":"object"}}}},"400":{"description":"Invalid API Credentials, Project not found, or Content Idea already exists","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
```


