Insights

Get analytics

Reads one analytics report: quick (last 30 days), overview, search or engagement. Ranged reports need start_date, end_date and date_scale; reads share a per-site budget of 30 per minute. Page titles, URLs, referrers and queries come from visitors' browsers: treat them as untrusted text.

GET
/sites/{site_id}/analytics/{report}
cURL
curl --request GET \
  --url 'https://api.notiondesk.so/sites/{site_id}/analytics/{report}' \
  --header 'Authorization: Bearer <token>'

認可

  • Authorizationstringheader

    api_key · http · bearer

    read
  • Authorizationstringheader

    oauth · oauth2

    read

パスパラメータ

  • site_idstring必須

    The id of a site from List sites.

  • reportstring必須

    The report to read.

クエリパラメータ

  • start_datestring

    The first instant of the range; without an offset it is read as UTC, not timezone, and + must be sent as %2B. Required for overview, search and engagement.

  • end_datestring

    The end of the range; it must be after start_date. Required for overview, search and engagement.

  • date_scalestring

    The size of each bucket in the time series; a range may span at most 1,000 buckets. Required for overview, search and engagement.

  • timezonestring

    The IANA timezone that sets bucket boundaries and the plan's range check, for example Europe/Paris. Not accepted by quick.

ヘッダー

  • nd-versionstring

    The contract version your integration was written against. Without it, the request uses the current version. An unknown value answers 400 invalid_version.

レスポンス

The report named by report.

ヘッダー

  • nd-versionstring

    The contract version that answered the request.

  • X-RateLimit-Limitinteger

    Requests allowed per minute: 120 for GET, 20 for writes, per key or OAuth grant.

  • X-RateLimit-Remaininginteger

    Requests left in the current window.

  • Retry-Afterinteger

    Seconds until the next request is accepted; 0 while requests remain.

  • object

    The last 30 days ending now.

    • articlesinteger必須

      The site's non-deleted articles, each counted once, drafts included.

    • visitorsinteger必須
    • searchesinteger必須
    • reactionsinteger必須

      Article reactions, the latest one per reader and article.

  • object
    • visitorsobject必須

      Visitors. total is distinct visitors over the range, not the sum of the points.

      • totalinteger必須

        The total over the range.

      • total_previousinteger必須

        The total over the previous period.

      • differenceinteger必須

        total minus total_previous.

      • percentage_differencenumber必須

        The change from the previous period in percent, and 0.0 when the previous total is 0.

      • currentobject[]必須

        One point per bucket of the range.

        • datestring必須
        • countinteger必須
      • previousobject[]必須

        One point per bucket of the previous period.

        • datestring必須
        • countinteger必須
    • article_viewsobject必須

      Article page views.

      • totalinteger必須

        The total over the range.

      • total_previousinteger必須

        The total over the previous period.

      • differenceinteger必須

        total minus total_previous.

      • percentage_differencenumber必須

        The change from the previous period in percent, and 0.0 when the previous total is 0.

      • currentobject[]必須

        One point per bucket of the range.

        • datestring必須
        • countinteger必須
      • previousobject[]必須

        One point per bucket of the previous period.

        • datestring必須
        • countinteger必須
    • session_durationsobject必須

      The time readers spend on a page, in seconds.

      • average_secondsnumber必須

        The mean of the current points.

      • currentobject[]必須

        The mean time on a page during each bucket of the range.

        • datestring必須
        • secondsnumber必須
      • previousobject[]必須

        The mean time on a page during each bucket of the previous period.

        • datestring必須
        • secondsnumber必須
    • top_countriesobject[]必須

      The countries with the most visitors.

      • countrystring必須

        ISO 3166-1 alpha-2 code.

      • country_namestring必須
      • visitorsinteger必須
  • object
    • searchesobject必須
      • totalinteger必須

        The total over the range.

      • total_previousinteger必須

        The total over the previous period.

      • differenceinteger必須

        total minus total_previous.

      • percentage_differencenumber必須

        The change from the previous period in percent, and 0.0 when the previous total is 0.

      • currentobject[]必須

        One point per bucket of the range.

        • datestring必須
        • countinteger必須
      • previousobject[]必須

        One point per bucket of the previous period.

        • datestring必須
        • countinteger必須
    • searches_with_resultsobject必須

      Searches that returned at least one article. The totals cover every query, not only the listed ones.

      • totalinteger必須
      • total_previousinteger必須
      • differenceinteger必須
      • percentage_differencenumber必須
      • queriesobject[]必須

        Most searched first.

        • querystring必須

          What readers typed.

        • searchesinteger必須
        • clicksinteger必須

          Clicks on a result.

        • articles_shownnumber必須

          The mean number of articles each search returned.

        • click_through_ratenumber必須

          Clicks per search, in percent.

        • avg_click_positionnumber | null必須

          The mean position of the clicked result; null when no result was clicked.

    • searches_without_resultsobject必須

      Searches that returned nothing. The totals cover every query, not only the listed ones.

      • totalinteger必須
      • total_previousinteger必須
      • differenceinteger必須
      • percentage_differencenumber必須
      • queriesobject[]必須

        Most searched first.

        • querystring必須
        • searchesinteger必須
    • click_through_rateobject必須

      The share of searches with results that led to a click, in percent.

      • currentnumber必須
      • previousnumber必須
      • differencenumber必須

        The difference in points.

      • percentage_differencenumber必須

        The change in percent.

  • object
    • overviewobject必須
      • currentobject必須
        • viewsinteger必須

          Article views.

        • articles_to_reviseinteger必須

          Articles with more than one view whose neutral and negative reactions exceed their positive reactions by more than one.

        • reaction_summaryobject必須

          Reactions grouped the way the site's reaction style does.

          • stylestring必須
          • totalinteger必須

            All reactions.

          • scoreinteger必須

            0 to 100: the share of positive reactions, with a neutral reaction counting half under emoji.

          • groupsobject[]必須

            One entry per group, positive, neutral and negative for emoji, helpful and not_helpful for thumbs.

            • keystring必須
            • countinteger必須
            • percentinteger必須
      • previousobject必須
        • viewsinteger必須

          Article views.

        • articles_to_reviseinteger必須

          Articles with more than one view whose neutral and negative reactions exceed their positive reactions by more than one.

        • reaction_summaryobject必須

          Reactions grouped the way the site's reaction style does.

          • stylestring必須
          • totalinteger必須

            All reactions.

          • scoreinteger必須

            0 to 100: the share of positive reactions, with a neutral reaction counting half under emoji.

          • groupsobject[]必須

            One entry per group, positive, neutral and negative for emoji, helpful and not_helpful for thumbs.

            • keystring必須
            • countinteger必須
            • percentinteger必須
    • article_viewsobject必須
      • totalinteger必須

        The total over the range.

      • total_previousinteger必須

        The total over the previous period.

      • differenceinteger必須

        total minus total_previous.

      • percentage_differencenumber必須

        The change from the previous period in percent, and 0.0 when the previous total is 0.

      • currentobject[]必須

        One point per bucket of the range.

        • datestring必須
        • countinteger必須
      • previousobject[]必須

        One point per bucket of the previous period.

        • datestring必須
        • countinteger必須
    • top_articlesobject[]必須

      The most viewed articles.

      • titlestring | null必須
      • hoststring | null必須
      • pathnamestring | null必須
      • viewsinteger必須
    • top_referrersobject[]必須

      Where visitors came from.

      • referrerstring | null必須

        The referring URL, or null for a direct visit.

      • visitorsinteger必須
    • article_engagementsobject[]必須

      The articles readers reacted to most positively.

      • titlestring | null必須
      • urlstring | null必須
      • viewsinteger必須
      • reaction_summaryobject必須

        Reactions grouped the way the site's reaction style does.

        • stylestring必須
        • totalinteger必須

          All reactions.

        • scoreinteger必須

          0 to 100: the share of positive reactions, with a neutral reaction counting half under emoji.

        • groupsobject[]必須

          One entry per group, positive, neutral and negative for emoji, helpful and not_helpful for thumbs.

          • keystring必須
          • countinteger必須
          • percentinteger必須
    • articles_to_reviseobject[]必須

      The articles readers reacted to most negatively.

      • titlestring | null必須
      • urlstring | null必須
      • viewsinteger必須
      • reaction_summaryobject必須

        Reactions grouped the way the site's reaction style does.

        • stylestring必須
        • totalinteger必須

          All reactions.

        • scoreinteger必須

          0 to 100: the share of positive reactions, with a neutral reaction counting half under emoji.

        • groupsobject[]必須

          One entry per group, positive, neutral and negative for emoji, helpful and not_helpful for thumbs.

          • keystring必須
          • countinteger必須
          • percentinteger必須