PHP Classes

DuckDuckGo PHP API client: Search for data and related topics from DuckDuckGo

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 135 All time: 9,291 This week: 57Up
Version License PHP version Categories
ddg-api 1.0.0GNU General Publi...7Searching, Web services, Parsers, PHP 7
Description 

Author

This package can search for data and related topics from DuckDuckGo.

It can send HTTP requests to the DuckDuckGo API Web server to perform search queries.

The class retrieves and parses the results that can be traversed to get the result texts and URLs.

Picture of Maik Greubel
  Performance   Level  
Name: Maik Greubel <contact>
Classes: 10 packages by
Country: Germany Germany
Age: ???
All time rank: 105967 in Germany Germany
Week rank: 287 Up9 in Germany Germany Up
Innovation award
Innovation award
Nominee: 4x

Recommendations

Multiple search engine search retrieval and storage
Need a engine to query different search engines

Documentation

Usage

composer.json

{
    "require" : {
        "php" : ">=7.0",
        "nkey/ddg-api" : "dev-master"
    }
}

Example php script:

use Nkey\DDG\API\JsonProvider;
use Nkey\DDG\API\QueryResultParser;

$provider = new JsonProvider();
$json = $provider->query("mount rushmore");

$parser = new QueryResultParser();
$results = $parser->parseQueryResult($json);

foreach($results->getRelatedTopics() as $relatedTopic) {
    printf('<a href="%s">%s</a>', $relatedTopic->getFirstURL(), $relatedTopic->getText());
}

Details

ddg-api

Build Status Code Coverage Scrutinizer Code Quality

This package provides means to access DuckDuckGo API using PHP.


  Files folder image Files (15)  
File Role Description
Files folder imagesrc (3 files, 1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data
Accessible without login Plain text file Usage.md Doc. Usage description

  Files folder image Files (15)  /  src  
File Role Description
Files folder imageModel (4 files)
  Plain text file ApiException.php Class Class source
  Plain text file JsonProvider.php Class Class source
  Plain text file QueryResultParser.php Class Class source

  Files folder image Files (15)  /  src  /  Model  
File Role Description
  Plain text file Icon.php Class Class source
  Plain text file Metadata.php Class Class source
  Plain text file QueryResult.php Class Class source
  Plain text file Result.php Class Class source

  Files folder image Files (15)  /  tests  
File Role Description
  Accessible without login Plain text file JsonProviderTest.php Test Unit test
  Accessible without login Plain text file test-data.json Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:135
This week:0
All time:9,291
This week:57Up