Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 2.04 KB

NewsApi.md

File metadata and controls

68 lines (45 loc) · 2.04 KB

Unifapi\Sdk\NewsApi

All URIs are relative to https://api.unifapi.com, except if the operation defines another base path.

Method HTTP request Description
newsSearchPost() POST /news/search Search News

newsSearchPost()

newsSearchPost($news_search_request): \Unifapi\\Sdk\Model\NewsSearchPost200Response

Search News

Run one live News search and receive the ranked news articles and top-stories blocks for a query, including title, publisher domain, snippet, image, and publish time.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\Api\NewsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$news_search_request = new \Unifapi\\Sdk\Model\NewsSearchRequest(); // \Unifapi\\Sdk\Model\NewsSearchRequest

try {
    $result = $apiInstance->newsSearchPost($news_search_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NewsApi->newsSearchPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
news_search_request \Unifapi\Sdk\Model\NewsSearchRequest [optional]

Return type

\Unifapi\Sdk\Model\NewsSearchPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]