Definition
The getKeywordCampaign API Command displays the history of the tracked keywords.
Cost
Using this command consumes 10 credit for each keyword.
Module
The command is included in the Campaign API Module and will only consume credits assigned for Campaign API Operations.
Parameters
| campaignId | The ID Number of the campaign. |
| siteId | The ID Number for the website. |
| dateFrom | The start date to track keywords from. *if no value inserted, the default is the first date found in the database. |
| dateTo | The end date to track keywords from. |
| date | Represents the day you wish to track keywords from. |
| se* | The Search Engine you want to add the keyword on. It’s not a mandatory field and can have the values: Google, Bing, Yahoo. |
| locale* | The country where the tracking is made. It’s not a mandatory field and can have values from here: http://support.cognitiveseo.com/knowledgebase/getsupportedcountrycodes/ |
| mobile* | Allows you to decide if the tracking should be made on mobile or desktop. It’s not mandatory and can take the values “yes” or “no”. The default is “no”. |
| location* | Allows you to choose the location of the tracking. It’s not mandatory and can take the standard values given by Google (Canonical Name for Geographical Targeting). The default is Universal Ranking. |
* None of these parameters are mandatory. However, if they are not specified, you will get all the data there is for that parameter. If for instance, you don’t give “mobile” a value, you will get data for both mobile and desktop.
Input URL Example
http://api.cognitiveseo.com/command.php?apiKey=your_api_key&command=getKeywordCampaign&campaignId=5&siteId=6&date=2015-01-10
Output Example
Running this command will result in the following JSON output:
{
"api": "cognitiveSEO API",
"data": {
"status": "success",
"data": {
"2015-01-10": {
"google penguin": {
"locale": "en-us",
"google": {
"position": "26",
"url": "http:\/\/cognitiveseo.com\/blog\/6741\/google-penguin-3-0-recoveries-and-penalties-analysis\/"
},
"bing": {
"position": null,
"url": null
},
"yahoo": {
"position": null,
"url": null
}
},
"google penguin case study": {
"locale": "en-us",
"google": {
"position": "4",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
},
"bing": {
"position": "1",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
},
"yahoo": {
"position": "1",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
}
},
"penguin case study": {
"locale": "en-us",
"google": {
"position": "8",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
},
"bing": {
"position": "5",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
},
"yahoo": {
"position": "5",
"url": "http:\/\/cognitiveseo.com\/blog\/803\/google-penguin-case-study\/"
}
}
}
},
"credits": 10
},
"time": 1.552
}
Output Details
| status | The status of the command (success or error). |
| locale | The country the keyword was tracked in. |
| position | The keyword’s position. |
| url | The URL in which the keyword ranks in. |
| credits | The credit cost of the command. |
| time | The time it took to process the command. |