filippo-toso/qwant-unofficial-api

Qwant非官方API客户端

v1.0.0 2017-10-10 08:42 UTC

This package is auto-updated.

Last update: 2024-08-29 00:13:33 UTC


README

qwant.com非官方API的一个简单客户端。

要求

  • PHP 5.6+
  • guzzlehttp/guzzle 6.2+

安装

使用Composer进行安装

composer require filippo-toso/qwant-unofficial-api

使用它

use FilippoToso\QwantUnofficialAPI\Client as QwantClient;

// Create the client
$client = new QwantClient('en_US');

// Get a list of suggested searches
$results = $client->suggest('market');
var_dump($results);

// Execute a generic search (default is for the web)
$results = $client->search('marketing');
var_dump($results);

// Get all the web results about the provided query
$results = $client->web('marketing');
var_dump($results);

// Get all the social results about the provided query
$results = $client->social('marketing');
var_dump($results);

// Get all the images about the provided query
$results = $client->images('marketing');
var_dump($results);

// Get all the news about the provided query
$results = $client->news('marketing');
var_dump($results);