Refer to the Rank Ranger API Overview page for information on how to obtain API access, obtain an API Key, error codes, and a full list of API methods.
key | string | The unique API key assigned to your account |
campaigns | string | Campaign ID number(s) with a comma between multiple IDs |
date | yyyy-mm-dd | Requested data date |
data_type |
string | rank_dashboard is the default and provides a rank snapshot based on the display columns added to the request Optional: domain_metrics provides Google, Majestic, Ahrefs, Moz, and Dmoz data for the primary domain, refer to Campaign Domain Metrics Export API documentation. |
file_option | string | per_camp is the default setting and provides 1 campaign per CSV file Optional: all_camp provides 1 CSV file containing all selected campaigns |
disp_columns | string | By default, the following columns are displayed in the report: campaign name, landing page URL, search engine URL,
search engine name, keyword, rank, and Google SERP indicators. Optional: you can add any or all of these parameters (with a comma between them) following &disp_columns= the request the additional data camp_manager returns the user-defined name entered in the Campaign Settings > General screen campaign manager field camp_ref_id returns the user-defined campaign reference ID entered in the General settings screen key_tags returns the keyword tags associated with each individual keyword vol returns the average search volume for each keyword total_res returns the number of total results displayed at the top of the Google search results screen for each keyword query avg_rank returns the average rank of all campaign keywords across each individual search engine |
avg_factor | string | avg_factor sets the rank threshold Optional: Average Rank rules can be set if you want the Average Rank to be calculated differently than the actual rank. The default is to include rank up to position 500 in the calculation, you change this to any number below 500 that you prefer, e.g., avg_factor=100 If you use avg_factor, you must also include avg_normalize_to |
avg_normalize_to | string | avg_normalize_to defines the rank that should be assigned when the actual rank exceeds the avg_factor threshold. Optional: this is required only if avg_factor is used, for example, &avg_factor=100&avg_normalize_to=101; this will cause a keyword rank of 180 to be counted as 101 when totaling the rank for averaging. |
inc_competitors | string | inc_competitors=true may be used to receive the competitor data that exists in the campaign for the requested date. Optional |
Construct & test API requests in the API Console or follow one of these examples: To retrieve default campaign rank data for 1 campaign https://www.rankranger.com/api/v2/?campaigns_rank_export&key=YOUR-API-KEY&campaigns=XXXXX&date=YYYY-MM-DD |
To retrieve all campaign rank data that is available via this API, for multiple campaigns in 1 CSV file https://www.rankranger.com/api/v2/?campaigns_rank_export&key=YOUR-API-KEY&campaigns=XXXXX,XXXXX,XXXXX&file_option=all_camp&disp_columns=camp_manager,camp_ref_id, key_tags,vol,total_res,avg_rank&avg_factor=XXX&avg_normalize_to=XXX&inc_competitors=true&date=YYYY-MM-DD |
After sending a properly constructed API request, the following message displays in the browser <tracking-data provider="rankranger" date="08/10/2016" time="13:59:37" status="ok">
<status>success</status>
<process_id>XXX</process_id>
</tracking-data>
The process_id is needed to obtain the status and download the file when the process is completed |
Code | Text | Description |
101 | Invalid Method |
Method does not exist, check your syntax |
102 | Invalid API Key |
The API Key inserted is invalid, check for key accuracy |
103 | Invalid Domain |
The Domain requested is invalid or does not exist in your account |
104 | Invalid Date |
The selected date range or syntax is invalid |
105 | Invalid Keyword |
The Keyword does not exist in this campaign |
202 | Invalid Campaign Name |
The Campaign name is invalid or missing |
203 | Invalid Primary URL |
The Primary URL is invalid or missing |
204 | Invalid Campaign ID |
The Campaign ID is invalid or missing |
208 | Invalid Search Engine |
Invalid Search Engine ID |
210 | Keyword already exists |
The Keyword already exists in this campaign |
211 | Keywords exist in campaign |
You need to delete Keywords from this campaign before trying to delete the campaign |
212 | Invalid Package ID |
Invalid Package ID |
215 | Custom White Label URL is already in use for another campaign |
The Custom URL that you have selected for your White Label Portal is in use by another campaign, please select a different URL |
400 | No Results |
No results were found |
401 | Limit Reached |
You have reached the maximum number of Campaigns allowed in your package |
406 | Too many processes requested |
The account has exceeded the limit on the number of exports that can be run and stored via the Campaigns > Import & Export > Campaign Export tool. After downloading the files, you may delete them in the Campaign Export screen or via the API. |