Google Trends

通过 News.Agent-API | 已更新 hace un año | News, Media

8.6 / 10





返回全部教程 (4)

How to use - /api/v1/DailyTrendingSearchNewsDetails Endpoint

The aim of this tutorial is to explain below items:

  1. API endpoint name: /api/v1/DailyTrendingSearchNewsDetails
  2. API endpoint accepting parameters: /{requestId}/{searchToken}/{newsArticleToken}
  3. How to use this API method.

This is the very first API endpoint you will need to call in order to access real time Google trends. It is accepting four (4) parameters , please see below for further details:

  1. {requestId} - This is a reference Id for you , so you can keep track when the API respond back to your call and in the respond it has the same request Id which you have sent in the request.
  2. {searchToken} - This is the token for the desired news title which you have received by calling /api/v1/DailyTrendingSearches Endpoint. As we explained from the response of (/api/v1/DailyTrendingSearches Endpoint) you will receive a collection of trending news titles, and once you have picked one of them, you can use it’s search token in this API method to query and get more details.
  3. {newsArticleToken} - This is the token for the desired news article which you have received by calling /api/v1/DailyTrendingSearchNewsArticles Endpoint.

Once you are familiar with above parameters, now it is time to know how to consume this API. Please see below simple steps:

Prepare your request:

  1. We hope you are using this API for a product or a project, so you can stick to your favorite programming language.
  2. Once you pick the programming language , all you have to do is, Use it’s HTTP client module to connect to this API.
  3. Rapid API also has put some examples so you could never go wrong.
  4. In your HTTP client module , please set the HTTP URL as :
  5. In your HTTP client module , please set the HTTP method as: GET
  6. Also you need to pass all the above parameters in this way:
  7. Also if you have subscribed to our API you should already have an API KEY, you need to add that as a herder key:value as below, into the HTTP request header section:
  8. x-rapidapi-key : {YOUR RAPID API KEY}

Using response :

  1. Once you have done above steps, Please see below which explain how to consume the response.
  2. In the response you would see below data
    “errorMessage”: “NULL”,
    “friendlyFormattedDate”: “Wednesday, 23 September 2020”,
    “googleTrendingNewsArticleDetails”: [
    “articleImageDetail”: {
    “imageUrl”: “”,
    “source”: “The Age”
    “articleNewsUrl”: “”,
    “articleSnippet”: “A teen missing for more than 30 hours in bushland east of Melbourne has been found dead.”,
    “articleSource”: “The Age”,
    “articleTimeAgo”: “14h ago”,
    “articleTitle”: “Missing teen William Wall found dead, police confirm”,
    “trendingSearchNewsArticleToken”: “73cf80b5-5c17-418d-b1e7-946a90a2f9e7”
    “tokenExpirationTime”: “Thursday, 24 September 2020 12:23:24”,
    “tokenExpirationTimeInUtc”: “Thursday, 24 September 2020 02:23:24”,
    “userRequestId”: “123”,
    “userSearchToken”: “c471a5e7-9519-49f2-827b-27055e88c215:AU-20200923”
  3. As you can see above response has in depth details on a specific article. which has been sent to above API endpoint as a Article Token and which are returned for a specific search token (Trending Title).
打分:5 - 投票:1