Skip to content

Latest commit

 

History

History
528 lines (365 loc) · 16 KB

File metadata and controls

528 lines (365 loc) · 16 KB

ScrapeBadger\BingApi

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

Method HTTP request Description
bingBingScraperHealthCheck() GET /v1/bing/health Bing scraper health check
bingBingScraperHealthCheckHead() HEAD /v1/bing/health Bing scraper health check
bingImageSearch() GET /v1/bing/images Image search
bingListSupportedMarkets() GET /v1/bing/markets List supported markets
bingNewsSearch() GET /v1/bing/news News search
bingSearchSuggestions() GET /v1/bing/autocomplete Search suggestions
bingVideoSearch() GET /v1/bing/videos Video search
bingWebSearch() GET /v1/bing/search Web search

bingBingScraperHealthCheck()

bingBingScraperHealthCheck(): mixed

Bing scraper health check

Check health of the Bing scraper service (accepts HEAD for UptimeRobot).

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);

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

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingBingScraperHealthCheckHead()

bingBingScraperHealthCheckHead(): mixed

Bing scraper health check

Check health of the Bing scraper service (accepts HEAD for UptimeRobot).

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);

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

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingImageSearch()

bingImageSearch($query, $market, $count, $safe_search): mixed

Image search

Bing Images — thumbnail, full-size and source URL per result.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);
$query = 'query_example'; // string | Search keywords, e.g. 'golden retriever'
$market = 'en-US'; // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets.
$count = 35; // int | Results to return
$safe_search = 'safe_search_example'; // string | off | moderate | strict

try {
    $result = $apiInstance->bingImageSearch($query, $market, $count, $safe_search);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BingApi->bingImageSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'golden retriever'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to 'en-US']
count int Results to return [optional] [default to 35]
safe_search string off moderate

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingListSupportedMarkets()

bingListSupportedMarkets(): mixed

List supported markets

Supported Bing market codes. Free — costs no credits.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);

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

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingNewsSearch()

bingNewsSearch($query, $market, $freshness): mixed

News search

Bing News — headline, source, published time and snippet per article.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);
$query = 'query_example'; // string | Search keywords, e.g. 'interest rates'
$market = 'en-US'; // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets.
$freshness = 'freshness_example'; // string | day | week | month — restrict to recent articles

try {
    $result = $apiInstance->bingNewsSearch($query, $market, $freshness);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BingApi->bingNewsSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'interest rates'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to 'en-US']
freshness string day week

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingSearchSuggestions()

bingSearchSuggestions($query, $market): mixed

Search suggestions

Bing search-box query suggestions.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);
$query = 'query_example'; // string | Partial search term, e.g. 'coff'
$market = 'en-US'; // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets.

try {
    $result = $apiInstance->bingSearchSuggestions($query, $market);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BingApi->bingSearchSuggestions: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Partial search term, e.g. 'coff'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to 'en-US']

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingVideoSearch()

bingVideoSearch($query, $market, $count, $safe_search): mixed

Video search

Bing Videos — title, thumbnail, duration, publisher and source per result.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);
$query = 'query_example'; // string | Search keywords, e.g. 'espresso tutorial'
$market = 'en-US'; // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets.
$count = 35; // int | Results to return
$safe_search = 'safe_search_example'; // string | off | moderate | strict

try {
    $result = $apiInstance->bingVideoSearch($query, $market, $count, $safe_search);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BingApi->bingVideoSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'espresso tutorial'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to 'en-US']
count int Results to return [optional] [default to 35]
safe_search string off moderate

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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

bingWebSearch()

bingWebSearch($query, $market, $count, $offset, $safe_search): mixed

Web search

Bing web SERP — organic results, ads, related searches and total count.

Example

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


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\BingApi(
    // 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
);
$query = 'query_example'; // string | Search keywords, e.g. 'coffee machine'
$market = 'en-US'; // string | Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets.
$count = 10; // int | Results per page (1-50)
$offset = 0; // int | Zero-based result offset for pagination
$safe_search = 'safe_search_example'; // string | off | moderate | strict (default moderate)

try {
    $result = $apiInstance->bingWebSearch($query, $market, $count, $offset, $safe_search);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BingApi->bingWebSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords, e.g. 'coffee machine'
market string Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. [optional] [default to 'en-US']
count int Results per page (1-50) [optional] [default to 10]
offset int Zero-based result offset for pagination [optional] [default to 0]
safe_search string off moderate

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

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

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