Skip to content

News API

Martim Pinto da Silva edited this page Apr 28, 2021 · 1 revision

Usearch News API

Context

  • Search and extract news articles and relevant web pages, for a given query and/or other parameters.
  • Endpoint Documentation

GET /api/search/NewsSearchAPI

Get news articles relevant for a given query.

Some parameters:

  • q - The user's search query string.
  • pageNumber - The page to view.
  • pageSize - The number of items per page. The maximum value is 50.
  • autoCorrect - Automatically correct spelling.
  • fromPublishedDate - The published date and time for the oldest article allowed. For example: 2015-05-16T05:50:06.
  • toPublishedDate - The published date and time for the newest article allowed. For example: 2015-05-16T05:50:06.

Some fields we can extract:

  • totalCount - number of total results in the response
  • relatedSearch - list with terms related to the original search
  • value - data array that contains information about all extracted articles
    • id - ID of the article
    • title - article title
    • description - brief description of the article
    • url - URL of the article
    • datePublished - timestamp of the article publication
    • language - language of the article
    • provider - object with information about the article provider
    • keywords - keywords related to the article
    • body - text body of the article

Use cases:

Extract news related with the keyword energy.

{
    "_type": "news",
    "didUMean": "",
    "totalCount": 907,
    "relatedSearch": [],
    "value": [
        {
            "id": "5719505941950064771",
            "title": "Energy Down As Covid-19 Restrictions In Europe Spur Demand Fears -- Energy Roundup",
            "url": "https://www.marketscreener.com/news/latest/Energy-Down-As-Covid-19-Restrictions-In-Europe-Spur-Demand-Fears-Energy-Roundup--32767311/?utm_medium=RSS&utm_content=20210323",
            "description": "Shares of energy companies slid as renewed Covid-19 containment measures in Europe moderated hopes for a resurgence in demand for fuels.    The bumpy reopening process in Europe is raising...",
            "body": "Become a member for free\nSign up",
            "keywords": "",
            "language": "en",
            "isSafe": true,
            "datePublished": "2021-03-23T20:43:00",
            "provider": {
                "name": "marketscreener",
                "favIcon": "",
                "favIconBase64Encoding": ""
            },
            "image": {
                "url": "",
                "height": 0,
                "width": 0,
                "thumbnail": "",
                "thumbnailHeight": 0,
                "thumbnailWidth": 0,
                "base64Encoding": "",
                "name": null,
                "title": null,
                "provider": {
                    "name": "marketscreener",
                    "favIcon": "",
                    "favIconBase64Encoding": ""
                },
                "imageWebSearchUrl": null,
                "webpageUrl": "https://www.marketscreener.com/news/latest/Energy-Down-As-Covid-19-Restrictions-In-Europe-Spur-Demand-Fears-Energy-Roundup--32767311/?utm_medium=RSS&utm_content=20210323"
            }
        }
    ]
}

GET /api/search/NewsSearchAPI

Get relevant web pages for a given query.

Some parameters:

  • q - The user's search query string.
  • pageNumber - The page to view.
  • pageSize - The number of items per page. The maximum value is 50.
  • autoCorrect - Automatically correct spelling.

Some fields we can extract:

  • totalCount - number of total results in the response
  • relatedSearch - list with terms related to the original search
  • value - data array that contains information about all extracted articles
    • id - ID of the web page
    • title - web page title
    • description - brief description of the web page
    • url - URL of the web page
    • language - language of the web page content
    • provider - object with information about the web page provider
    • keywords - keywords related to the web page
    • body - text body of the web page

Use cases:

Search web pages related with the keyword energy.

{
    "_type": "all",
    "didUMean": "",
    "totalCount": 1498,
    "relatedSearch": [
        "energy",
        "<b>renewable energy</b>",
        "<b>solar energy</b>",
        "<b>energy efficiency</b>",
        "<b>energy news</b>",
        "<b>clean energy</b>",
        "<b>energy job</b>",
        "<b>energy management</b>",
        "<b>local energy</b>",
        "<b>solar power energy</b>",
        "<b>local solar power energy</b>",
        "<b>energy storage</b>"
    ],
    "value": [
        {
            "id": "5151874770039833153",
            "title": "Department of Energy",
            "url": "https://www.energy.gov/",
            "description": "Energy.gov",
            "body": "Secretary Brouillette to Travel to Pittsburgh, Pennsylvania\nSecretary Brouillette will highlight the importance of Appalachian natural gas and innovative technology development in the region.\nSeptember 20, 2020\nView Article\nSecretary Brouillette and National Economic Council Director Larry Kudlow Host Natural Gas Summit\nThe summit will also feature DOE officials, U.S. gas industry leaders, and global liquefied natural gas market representatives.\nSeptember 15, 2020\nUnder Secretary for Science Paul Dabbar to Visit Brookhaven National Laboratory with Elected Officials and Science Partners\nUnder Secretary Dabbar will announce the launch of the project to build an Electron-Ion Collider.\nSeptember 15, 2020\nView Article\nUnder Secretary for Science Paul Dabbar to Join NASA Administrator Jim Bridenstine in Tulsa for Space Roundtable\nRepresentatives from the University of Tulsa and Oklahoma State University, and private sector partners in the space industry will also participate.\nSeptember 11, 2020\nView Article\nSecretary Brouillette In Louisiana ***Updated***\nSecretary Brouillette will meet with Gov. John Bel Edwards to discuss the long-term impacts of Hurricane Laura on the energy industry in Louisiana.\nSeptember 8, 2020\nDeputy Secretary of Energy Mark W. Menezes to Visit SHINE Medical Technologies Facilities and NorthStar Medical Radioisotopes\nThe Deputy Secretary will tour the facilities on Friday, September 11th, 2020.\nSeptember 8, 2020\nSecretary Brouillette to Travel to Louisiana\nSecretary Brouillette will travel to New Orleans, Baton Rouge and Hackberry, Louisiana.\nSeptember 7, 2020\nView Article\nSECRETARY BROUILLETTE TO JOIN SOUTH CAROLINA OFFICIALS FOR HISTORIC ANNOUNCEMENT\nSecretary Brouillette will join South Carolinas Attorney General Alan Wilson and other officials for a major announcement.\nAugust 29, 2020\nView Article\nSecretary Brouillette to Travel to North Dakota\nOn Tuesday, September 1, 2020, U.S. Secretary of Energy Dan Brouillette will be in Minot, North Dakota to tour the Minot Air Force Base",
            "keywords": "",
            "language": "en",
            "isSafe": true,
            "datePublished": "0001-01-01T00:00:00",
            "provider": {
                "name": "energy",
                "favIcon": "",
                "favIconBase64Encoding": ""
            },
            "image": {
                "url": "",
                "height": 0,
                "width": 0,
                "thumbnail": "",
                "thumbnailHeight": 0,
                "thumbnailWidth": 0,
                "base64Encoding": "",
                "name": null,
                "title": null,
                "provider": {
                    "name": "energy",
                    "favIcon": "",
                    "favIconBase64Encoding": ""
                },
                "imageWebSearchUrl": null,
                "webpageUrl": "https://www.energy.gov/"
            }
        }
    ]
}
Clone this wiki locally