• More
    • Settings
    • Goodies
    • About
    • Help
    • Feedback
    • PRIVACY
    • DontTrack
    • DontBubble
    • Policy
    • COMMUNITY
    • Platform
    • Forum
    • Chat
    • Spread
Zero-click Info API
Our Zero-click Info API gives you free access to much of our topic summaries (API example), categories (API example), disambiguation (API example), !bang redirects (API example), definitions (API example), and more (API example).

This information comes from a variety of sources, including Wikipedia, Wikia, Crunchbase, GitHub, WikiHow, The Free Dictionary and dozens more.

This API serves about 5,000,000 queries a day for a variety of uses, e.g.:

  • Defines people, places, things, words and concepts.
  • Provides direct links to other services (via !bang syntax).
  • Lists related topics.
  • Gives official sites when available.

Some consumers of this API:

Our Apps Cyberspace FastestFox

To consume it yourself, you can use one of the language libraries listed below or simply add '&format=json' (or xml if you have a death wish) onto any query URL in the api subdomain, e.g.
http://api.duckduckgo.com/?q=DuckDuckGo&format=xml

The only requirement is link attribution in each place you use the info for both us and any underlying source. Our goal is to get more people using DuckDuckGo, so keep that in mind. Also, please use a descriptive useragent.

Here are the return fields:

Abstract: topic summary (can contain HTML, e.g. italics)
AbstractText: topic summary (with no HTML)
AbstractSource: name of Abstract source
AbstractURL: deep link to expanded topic page in AbstractSource
Image: link to image that goes with Abstract
Heading: name of topic that goes with Abstract

Answer: instant answer
AnswerType: type of Answer, e.g. calc, color, digest, info, ip, iploc, phone, pw, rand, regexp, unicode, upc, or zip (see goodies & tech pages for examples).

Definition: dictionary definition (may differ from Abstract)
DefinitionSource: name of Definition source
DefinitionURL: deep link to expanded definition page in DefinitionSource

RelatedTopics: array of internal links to related topics associated with Abstract
  Result: HTML link(s) to related topic(s)
  FirstURL: first URL in Result
  Icon: icon associated with related topic(s)
    URL: URL of icon
    Height: height of icon (px)
    Width: width of icon (px)
  Text: text from first URL

Results: array of external links associated with Abstract
  Result: HTML link(s) to external site(s)
  FirstURL: first URL in Result
  Icon: icon associated with FirstURL
    URL: URL of icon
    Height: height of icon (px)
    Width: width of icon (px)
  Text: text from FirstURL

Type: response category, i.e. A (article), D (disambiguation), C (category), N (name), E (exclusive), or nothing.

Redirect: !bang redirect URL

Here are all the parameters:

q: query


format: output format (json or xml)

If format=='json', you can also pass:

callback: function to callback (JSONP format)
pretty: 1 to make JSON look pretty (like JSONView for Chrome/Firefox)


no_redirect: 1 to skip HTTP redirects (for !bang commands).


no_html: 1 to remove HTML from text, e.g. bold and italics.


skip_disambig: 1 to skip disambiguation (D) Type.

Notes

  • As this is a Zero-click Info API, most deep queries (non topic names) will be blank.
    {
    Abstract: ""
    AbstractText: ""
    AbstractSource: ""
    AbstractURL: ""
    Image: ""
    Heading: ""
    Answer: ""
    Redirect: ""
    AnswerType: ""
    Definition: ""
    DefinitionSource: ""
    DefinitionURL: ""
    RelatedTopics: [ ]
    Results: [ ]
    Type: ""
    }
    

  • Icons, i.e. the underlying images, may be greater than their specified Width/Height. You should explicitly set them to the specified measurements (if provided).

  • For disambiguation pages (Type=='D'), RelatedTopics can be grouped into sections. In that case, RelatedTopics is an array of hashes. Each hash has a Name key and a Topics array matching the above RelatedTopics description. If you want to avoid this case altogether, use the disambiguation skip parameter (skip_disambig).

  • For !bang commands, the redirect will happen at the HTTP level (since that is fastest), but it will also be returned in the content (for parsing). If you don't want the redirect to happen in the HTTP header, use the no_redirect flag.

  • Queries can be case sensitive e.g. blackberry (API example) vs BlackBerry (API example). In the first case (lowercase blackberry) it returns a disambiguation page; in the latter case (MixedCase BlackBerry) it returns info primarly about the device (inferring what you meant from the case).

  • This API can work over an encrypted (SSL/HTTPS) connection.

FAQ

Are there supporting library integrations?

  • You can consume this API via Mashape, which provides PHP, Ruby, Python, Objective-C and Java (including Android) libraries. To do so, sign up (use the code DUCKDUCK) and login.
  • Perl module & command line app by @raudssus.
  • Python library by mikejs.
  • Zero-click jQuery Search Widget by @dhruvbird that provides info for you in iframe format.
  • jddg jQuery plugin [demo] by Siegfried Ehret
  • Ruby Gem by Andrew Jones
  • If you make another supporting library, we'll add it here!

Why is x query blank? Where are all the Web links like on the main site?

This is a Zero-click Info API, and not a full results API. However, there are some Web links within it, e.g. official sites.

So is there then another API with all the Web links?

Since we use many underlying APIs in our full results (merged with our own indexes), we do not have rights at this time provide an API with all our Web links. We do, however, provide search box integration.

Why is y query blank? I see Zero-click Info on the main site!

Not all of our Zero-click Info is available via this API for a variety of reasons. However, if you would like to see something please let us know and perhaps we can make it happen.

If you have more questions, please let us know.