Skip to content
On this page

URLs

URLs represent a site or domain for which a set of keywords are being tracked. Althought these two last functionalities have their own endpoint, but their specific settings are configured with the URL endpoint.

URL data

FieldDescription
idURL ID
url_typeURL engine type (deprecated)
urlURL
last_processed_atTime when number of Google indexed pages was last retrieved
created_atTime when this URL was created
keyword_countNumber of keywords this URL has
domain_authorityDomain authority ranking
domain_authority_changeLast observed change in domain authority
google_indexedNumber of pages indexed by Google
keyword_changesHow many keywords went up (1), went down (-1), or stayed the same (0)
url_group_idGroup ID this URL belongs to
places_infoPlace extended matching data
places_info.place_cidMatch place by CID
places_info.place_titleMatch place by title
places_info.place_descriptionPlaces description, informational, no matching is performed on description
url_infoPlaces_info alias
places_matchPlace's CID (cid_<CID> format) or, if CID is empty, place's title
places_keyword(deprecated)
places_image_titleTitle for tracking in image carousel
custom_nameCustom URL name
youtube_video_idYoutube video ID, for Youtube video tracking purposes
youtube_channelYoutube channel name, for Youtube channel tracking purposes
competitorsList of competitors this URL has
google_indexed_changeDaily change of number of pages index by Google
report_countHow many reports this URL has
google_analytics_profile_idGoogle Analytics profile ID, might be empty if GA integration is not setup
country_codeISO3166 alpha-2 country code
language_codeISO639 language code
search_console_urlGoogle Search Console URL this URL matches with
include_local_pack_in_main_positionWhether to include local pack rankings in the main one (boolean, default: true)
include_places_image_in_main_positionWhether to include image carousel rankings in the main one (boolean, default: true)
include_featured_snippet_in_main_positionWhether to include feature snippets rankings in the main one (boolean, default: true)
include_knowledge_panel_in_main_positionWhether to include knowledge panel rankings in the main one (boolean, default: true)
crawling_session_path_ignore_patternIgnore path patterns for site audits
crawling_session_url_params_enabledWhether to include query parameters in site audits (boolean, default: true)
crawling_session_follow_nofollow_linksWhether to follow nofollow links in site audits (boolean, default: true)
match_subdomainsWhether to match subdomains (boolean, default: false)
match_nested_urlsWhether to match subpaths in the URL (boolean, default: true)
site_audit_intervalRecurring site audit intervals (in seconds, accepted valud are: 604800 (1 week) and 2592000 (30 days))
domains
next_site_audit_crawl_atNext time a recurring site audit will happen (read only)
site_audit_intervalRecurring site audit intervals (in seconds, accepted valud are: 604800 (1 week) and 2592000 (30 days))
match_subdomainsWhether to match URL subdomains
match_nested_urlsWhether to match URL subpaths

List URLs

shell
curl 'https://api.nightwatch.io/api/v1/urls?access_token=ACCESS_TOKEN' \\
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

json
[
  {
    "id": 31234,
    "url_type": "google",
    "url_info": {},
    "url": "http://example.com",
    "last_processed_at": "2019-07-21T00:00:53.892Z",
    "created_at": "2013-10-08T17:38:43.800Z",
    "keyword_count": 17,
    "domain_authority": 1,
    "domain_authority_change": -1,
    "google_indexed": 24,
    "keyword_changes": {
      "0": 16,
      "1": 1,
      "-1": 0
    },
    "url_group_id": 36241,
    "places_info": null,
    "places_match": null,
    "places_keyword": null,
    "places_image_title": null,
    "custom_name": "",
    ...
  },
  ...
]

HTTP Request

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

URL Parameters

ParameterDescription
group_idOnly return URLs belonging to this group (optional)

Get a URL

shell
curl 'https://api.nightwatch.io/api/v1/urls/31234?access_token=ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

json
{
  "id": 31234,
  "url_type": "google",
  "url_info": {},
  "url": "http://example.com",
  "last_processed_at": "2019-07-21T00:00:53.892Z",
  "created_at": "2013-10-08T17:38:43.800Z",
  "keyword_count": 17,
  "domain_authority": 1,
  "domain_authority_change": -1,
  "google_indexed": 24,
  "keyword_changes": {
    "0": 16,
    "1": 1,
    "-1": 0
  },
  "url_group_id": 36241,
  "places_info": null,
  "places_match": null,
  "places_keyword": null,
  "places_image_title": null,
  "custom_name": "",
  ...
}

HTTP Request

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

URL Parameters

ParameterDescription
url_idThe id of the URL to be fetched

Create a URL

shell
curl 'https://api.nightwatch.io/api/v1/urls?access_token=ACCESS_TOKEN' \\
  -X POST \\
  -H 'Content-Type: application/json' \\
  -d '
    {
      "url": {
        "url": "example.com",
        "custom_name": "Example Site",
        "country_code": "us",
        "language_code": "en",
        "places_match": null,
        "match_nested_urls": false,
        "match_subdomains": false,
        "url_group_id": 1234,
      }
    }
  '

The above command returns JSON structured like this:

json
{
  "id": 31234,
  "url_type": "google",
  "url_info": {},
  "url": "http://example.com",
  "last_processed_at": "2019-07-21T00:00:53.892Z",
  "created_at": "2013-10-08T17:38:43.800Z",
  "keyword_count": 17,
  "domain_authority": 1,
  "domain_authority_change": -1,
  "google_indexed": 24,
  "keyword_changes": {
    "0": 16,
    "1": 1,
    "-1": 0
  },
  "url_group_id": 36241,
  "places_info": null,
  "places_match": null,
  "places_keyword": null,
  "places_image_title": null,
  "custom_name": "",
  ...
}

HTTP Request

POST https://api.nightwatch.io/api/v1/urls?access_token=ACCESS_TOKEN

Body Parameters

ParameterDescription
url*URL to track
custom_nameCustom URL name, used for displaying purposes
country_code*ISO3166 alpha-2 coutry code
language_code*ISO639-1 language code
places_matchPlace name or CID
match_nested_urlsWhether to match subpaths in the URL
match_subdomainsWhether to match subdomains
url_group_id*Group this URL will belong to

Parameters marked with * are mandatory.

INFO

Country and language codes are used for retrieving the number of indexed pages by Google, and as a default setting for keywords. However, keywords have their own location and language specification, and are not affected by these settings.

Update a URL

shell
curl 'https://api.nightwatch.io/api/v1/urls/31234?access_token=ACCESS_TOKEN' \\
-X PUT \\
-H 'Content-Type: application/json' \\
-d '
  {
    "url": {
      "url": "www.example.com"
      "custom_name": "Example URL"
      "country_code": "si"
      "language_code": "sl"
      "places_match": "cid_123456789"
      "match_nested_urls": true
      "match_subdomains": false
      "url_group_id": 12345
    }
  }

The above command returns JSON structured like this:

json
[
  {
    "id": 31234,
    "url_type": "google",
    "url_info": {},
    "url": "http://example.com",
    "last_processed_at": "2019-07-21T00:00:53.892Z",
    "created_at": "2013-10-08T17:38:43.800Z",
    "keyword_count": 17,
    "domain_authority": 1,
    "domain_authority_change": -1,
    "google_indexed": 24,
    "keyword_changes": {
      "0": 16,
      "1": 1,
      "-1": 0
    },
    "url_group_id": 36241,
    "places_info": null,
    "places_match": null,
    "places_keyword": null,
    "places_image_title": null,
    "custom_name": "",
    ...
  }
]

HTTP Request

PUT https://api.nightwatch.io/api/v1/urls/URL_ID?access_token=ACCESS_TOKEN

Body Parameters

ParameterDescription
URL_IDURL ID
url_group_idGroup ID this URL belong to
places_matchPlace name or CID
custom_nameCustom URL name, used for displaying purposes
country_codeISO3166 alpha-2 country code
language_codeISO639 language code
include_local_pack_in_main_positionWhether to include local pack rankings in the main one (boolean, default: true)
include_places_image_in_main_positionWhether to include image carousel rankings in the main one (boolean, default: true)
include_featured_snippet_in_main_positionWhether to include feature snippets rankings in the main one (boolean, default: true)
include_knowledge_panel_in_main_positionWhether to include knowledge panel rankings in the main one (boolean, default: true)
crawling_session_path_ignore_patternIgnore path patterns for site audits
crawling_session_url_params_enabledWhether to include query parameters in site audits (boolean, default: true)
crawling_session_follow_nofollow_linksWhether to follow nofollow links in site audits (boolean, default: true)
match_subdomainsWhether to match subdomains (boolean, default: false)
match_nested_urlsWhether to match subpaths in the URL (boolean, default: true)
site_audit_intervalRecurring site audit intervals (in seconds, accepted valud are: 604800 (1 week) and 2592000 (30 days))

Delete a URL

shell
curl 'https://api.nightwatch.io/api/v1/urls/31234?access_token=ACCESS_TOKEN' \\
  -X DELETE \\
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

json
{
  "id": 31234,
  "url_type": "google",
  "url_info": {},
  "url": "http://example.com",
  "last_processed_at": "2019-07-21T00:00:53.892Z",
  "created_at": "2013-10-08T17:38:43.800Z",
  "keyword_count": 17,
  "domain_authority": 1,
  "domain_authority_change": -1,
  "google_indexed": 24,
  "keyword_changes": {
    "0": 16,
    "1": 1,
    "-1": 0
  },
  "url_group_id": 36241,
  "places_info": null,
  "places_match": null,
  "places_keyword": null,
  "places_image_title": null,
  "custom_name": "",
  ...
}

HTTP Request

DELETE https://api.nightwatch.io/api/v1/urls/URL_ID?access_token=ACCESS_TOKEN

URL Parameters

ParameterDescription
group_idThe id of the group