Skip to content
On this page

Data Stats

Calculates statistics for a specified URL or View in a given date range.

Keyword Stats

shell
curl 'https://api.nightwatch.io/api/v1/keyword_stats?access_token=ACCESS_TOKEN&start_date=07-03-2019&end_date=08-02-2019&dynamic_view_id=5106&url_id=80337' \\
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

json
  {
    "average_position": 39.0,
    "average_position_change": -24.3,
    "search_visibility_index": 3.7,
    "search_visibility_index_change": -76.7,
    "click_potential": 163.2,
    "click_potential_change": -412.0,
    "top3_count": 0,
    "top3_change": -2,
    "top10_count": 0,
    "top10_change": 0,
    "top100_count": 2,
    "top100_change": 1,
    "no_rank_count": 0,
    "no_rank_change": 0,
    "keywords_went_up": 0,
    "keywords_went_down": 2,
    "keywords_unchanged": 0,
    "keyword_count": 4,
    "url_count": 1,
    "average_positions": [
      ["2019-07-03", 14.67],
      ["2019-07-04", 8.0],
      ...
    ],
    "search_visibility_series": [
      ["2019-07-03", 80.4],
      ["2019-07-04", 8.17],
      ...
    ],
    "click_potential_series": [
      ["2019-07-03", 575.16],
      ["2019-07-04", 348.37],
      ...
    ],
    "keyword_distribution_series": [
      [
        "2019-07-03",
        {
          "top_3": 2.0,
          "top_10": 0.0,
          "top_100": 1.0,
          "no_rank": 0.0
        }
      ],
      [
        "2019-07-04",
        {
          "top_3": 0.0,
          "top_10": 1.0,
          "top_100": 0.0,
          "no_rank": 0.0
        }
      ],
      ...
    ],
    "keyword_up_down_series": [
      [
        "2019-07-03",
        {
          "went_up": 3.0,
          "went_down": 0.0,
          "stagnant": 0.0
        }
      ],
      [
        "2019-07-04",
        {
          "went_up": 1.0,
          "went_down": 0.0,
          "stagnant": 0.0
        }
      ],
      ...
    ],
    "indexed_pages": 289,
    "indexed_pages_change": -117,
    "indexed_pages_series": [
      ["2019-07-03", 406],
      ["2019-07-04", 317],
      ...
    ],
    "traffic_values": [
      ["2019-07-03", 20.68],
      ["2019-07-04", 19.21],
      ...
    ],
    // using 'include_organic=true'
    "average_organic_positions": [
      ["2019-07-03", 14.67],
      ["2019-07-04", 8.0],
      ...
    ],
    // using 'include_organic=true'
    "organic_keyword_distribution_series": [
      [
        "2019-07-03",
        {
          "top_3": 2.0,
          "top_10": 0.0,
          "top_100": 1.0,
          "no_rank": 0.0
        }
      ],
      [
        "2019-07-04",
        {
          "top_3": 0.0,
          "top_10": 1.0,
          "top_100": 0.0,
          "no_rank": 0.0
        }
      ],
      ...
  }

HTTP Request

GET https://api.nightwatch.io/api/v1/keyword_stats?access_token=ACCESS_TOKEN

URL Parameters

ParameterDescription
start_date*The starting date in YYYY-MM-DD format (e.g. 2019-01-01)
end_date*The ending date in YYYY-MM-DD format (e.g. 2019-01-31)
url_idThe URL id to calculate stats for
dynamic_view_idThe dynamic view id to calculate stats for
include_organic(Optional) Must be true to include organic stats

It's mandatory to specify either an url_id or dynamic_view_id.

Available stats:

StatDescription
average_positionLatest average rank
average_position_changeAverage rank change
search_visibility_indexLatest search visibility index (more info)
search_visibility_index_changeSearch visibility index change
click_potentialLatest click potential (more info)
click_potential_changeClick potential change
top3_countLatest distribution of keywords in top 3 ranks
top3_changeChange in distribution of keywords in top 3 ranks
top10_countLatest distribution of keywords in top 10 ranks
top10_changeChange in distribution of keywords in top 10 ranks
top100_countLatest distribution of keywords in top 100 ranks
top100_changeChange in distribution of keywords in top 100 ranks
no_rank_countLatest distribution of keywords not ranking
no_rank_changeChange in distribution of keywords not ranking
keywords_went_upNumber of keywords that went up
keywords_went_downNumber of keywords that went down
keywords_unchangedNumber of keywords that remained unchanged
keyword_countTotal number of keywords
url_countTotal number of URLs
average_positionsAverage position time series
search_visibility_seriesSearch visibility time series
click_potential_seriesClick potential time series
keyword_distribution_seriesKeyword distribution time series
keyword_up_down_seriesKeywords up/down time series
indexed_pagesLatest number of pages indexed by Google
indexed_pages_changeThe change of number of pages indexed by Google
indexed_pages_seriesThe number of pages indexed by Google time series
traffic_valuesLatest traffic value (more info)
average_organic_positionsAverage organic position time series (returned only when include_organic=true)
organic_keyword_distribution_seriesOrganic keyword distribution time series (returned only when include_organic=true)