Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated pages

  • Loading branch information...
commit 377a2493140a0d5c2098415b15998b6004b13fe2 1 parent 0968744
@Getty Getty authored
View
146 share/site/duckduckgo/api.tx
@@ -13,79 +13,57 @@ pre {
}
</style>
-<div id="zero_click_header"><: l('Zero-click Info API') :></div>
+<div id="zero_click_header"><: l('Instant Answer API') :></div>
<: include "untranslated.tx" :>
<div style="margin-bottom:30px;"></div>
-
-Our Zero-click Info API gives you free access to much of our
+Our Instant Answer API gives you free access to many of our instant answers like:
<a href="http://duckduckgo.com/?q=valley+forge+national+park">topic summaries</a>
(<a href="http://api.duckduckgo.com/?q=valley+forge+national+park&format=json&pretty=1">API example</a>),
<a href="http://duckduckgo.com/?q=simpsons+characters">categories</a>
(<a href="http://api.duckduckgo.com/?q=simpsons+characters&format=json&pretty=1">API example</a>),
<a href="http://duckduckgo.com/?q=apple">disambiguation</a>
(<a href="http://api.duckduckgo.com/?q=apple&format=json&pretty=1">API example</a>),
-<a href="/bang">!bang redirects</a>
+<a href="/bang.html">!bang redirects</a>
(<a href="http://api.duckduckgo.com/?q=!imdb+rushmore&format=json&pretty=1&no_redirect=1">API example</a>),
+and
<a href="http://duckduckgo.com/?q=define+ostensibly">definitions</a>
-(<a href="http://api.duckduckgo.com/?q=define+ostensibly&format=json&pretty=1">API example</a>), and
-<a href="http://duckduckgo.com/?q=24*60*60">more</a>
-(<a href="http://api.duckduckgo.com/?q=24*60*60&format=json&pretty=1">API example</a>).
-
+(<a href="http://api.duckduckgo.com/?q=define+ostensibly&format=json&pretty=1">API example</a>).
-<p style="margin-top: 25px;">
-This information comes from a variety of sources, including<a href="http://wikipedia.org">Wikipedia</a>, <a href="http://wikia.com/">Wikia</a>, <a href="http://crunchbase.com">Crunchbase</a>, <a href="http://github.com">GitHub</a>, <a href="http://wikihow.com">WikiHow</a>, <a href="http://thefreedictionary.com">The Free Dictionary</a> and dozens more.
-</p>
+<div style="margin-bottom:20px;"></div>
+Our long-term goal is for <a href="https://duckduckgo.com/goodies/">all of our instant answers</a> to be available through this open API. Many of these instant answers are open source via our <a href="http://duckduckhack.com/">DuckDuckHack</a> platform. Using that platform, you can add your own APIs and data sources as well.
+
+<p style="margin-top: 20px;">
+Our instant answers come from a variety of sources, including <a href="http://wikipedia.org">Wikipedia</a>, <a href="http://wikia.com/">Wikia</a>, <a href="http://crunchbase.com">Crunchbase</a>, <a href="http://github.com">GitHub</a>, <a href="http://wikihow.com">WikiHow</a>, <a href="http://thefreedictionary.com">The Free Dictionary</a> &ndash; over 100 in total.
+
+<p style="margin-top: 20px;">
+ This API serves <a href="/traffic.html">over 10,000,000 queries a day</a> for a variety of uses, e.g.:
-<p style="margin-top: 25px;">
- This API serves <a href="/traffic.html">over 5,000,000 queries a day</a> for a variety of uses, e.g.:
-</p>
<ul>
-<li>Defines people, places, things, words and concepts.
-<li>Provides direct links to other services (via <a href="/bang">!bang syntax</a>).
-<li>Lists related topics.
-<li>Gives official sites when available
+<li>Defining people, places, things, words and concepts, e.g. for side-bars, onMouseover or onHiglight.
+<li>Providing direct links to other services (via <a href="/bang.html">!bang syntax</a>).
+<li>Listing related topics.
+<li>Giving official sites when available.
</ul>
-
-<p style="margin-top: 25px;">
-Some consumers of this API:
-</p>
-
-<p style="margin-top: 15px;">
-<table>
-<tr>
-<td valign="top" class="small" align="center">
-<a href="/tools.html"><img src="/tools/ios.png"></a>
-<a href="/tools.html">Our Apps</a>
-</td>
-<td valign="top" class="small" style="padding-left: 30px;" align="center">
-<a href="http://itunes.apple.com/app/cyberspace/id403114491?mt=8"><img src="/tools/cyberspace.png"></a>
-<a href="http://itunes.apple.com/app/cyberspace/id403114491?mt=8">Cyberspace</a>
-</td>
-<td valign="top" class="small" style="padding-left: 30px;" align="center">
-<a href="https://addons.mozilla.org/en-US/firefox/addon/9825/"><img src="/tools/fastestfox.png"></a>
-<a href="https://addons.mozilla.org/en-US/firefox/addon/9825/">FastestFox</a>
-</td>
-<td valign="top" class="small" style="padding-left: 30px;">
-<a href="http://blekko.com/"><img src="/tools/blekko.png"></a>
-</td>
-</tr>
-</table>
-</p>
<p style="margin-top: 25px;">
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.
-<br><a href="http://api.duckduckgo.com/?q=DuckDuckGo&format=xml&pretty=1">http://api.duckduckgo.com/?q=DuckDuckGo&format=xml</a>
-</p>
+<br><a href="http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1">http://api.duckduckgo.com/?q=DuckDuckGo&format=json</a>
<p style="margin-top: 25px;">
-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 requirements for use:
+<ul>
+<li>Link attribution in each place you use the info for both us and any underlying source.
+<li>Non-commercial use unless you get email approval from us (though we're generally fine with anything that isn't sketchy).
+<li>Use a descriptive useragent where possible. (We don't save full user agents but this can be handy in debugging situations).
+</ul>
-</p>
+Our overall goal is to get more people using DuckDuckGo, so please keep that in mind as well.
<p style="margin-top: 25px;">
Here are the return fields:
+<p style="margin-top: 5px;">
<pre>
Abstract: topic summary (can contain HTML, e.g. italics)
AbstractText: topic summary (with no HTML)
@@ -95,7 +73,7 @@ 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 <a href="/goodies">goodies</a> page for examples).
+AnswerType: type of Answer, e.g. calc, color, digest, info, ip, iploc, phone, pw, rand, regexp, unicode, upc, or zip (see <a href="http://duckduckgo.com/goodies.html">goodies</a> & <a href="http://duckduckgo.com/tech.html">tech</a> pages for examples).
Definition: dictionary definition (may differ from Abstract)
DefinitionSource: name of Definition source
@@ -124,10 +102,9 @@ Type: response category, i.e. A (article), D (disambiguation), C (category), N (
Redirect: !bang redirect URL
</pre>
-</p>
-
<p style="margin-top: 20px;">
Here are all the parameters:
+<p style="margin-top: 5px;">
<pre>
q: query
@@ -149,11 +126,10 @@ no_html: 1 to remove HTML from text, e.g. bold and italics.
skip_disambig: 1 to skip disambiguation (D) Type.
</pre>
-</p>
<p style="margin-top: 35px;">
<b>Notes</b>
<ul>
-<li class="small">As this is a Zero-click Info API, most deep queries (non topic names) will be blank.
+<li class="small">As this is an instant answer API, most deep queries (non topic names) will be blank.
<pre>
{
Abstract: ""
@@ -173,91 +149,75 @@ Results: [ ]
Type: ""
}
</pre>
-</li>
-
-</p>
<!--
<p style="margin-top: 5px;">
<li class="small">If there is no icon for a given Topic or Result, Icon will be a blank hash, i.e. {}, instead of a hash with every sub-field being an empty string.
-</p>
//-->
-
<p style="margin-top: 5px;">
<li class="small">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).
-</p>
<p style="margin-top: 5px;">
-<li class="small">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).</li>
-</p>
+<li class="small">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).
<p style="margin-top: 5px;">
-<li class="small">For <a href="/bang">!bang commands</a>, 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.</li>
-</p>
+<li class="small">For <a href="/bang.html">!bang commands</a>, 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.
<p style="margin-top: 5px;">
<li class="small">Queries can be case sensitive e.g.
<a href="/?q=blackberry">blackberry</a> (<a href="http://api.duckduckgo.com/?q=blackberry&format=json&pretty=1">API example</a>)
vs
-<a href="/?q=BlackBerry">BlackBerry</a> (<a href="http://api.duckduckgo.com/?q=BlackBerry&format=json&pretty=1">API example</a>). 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).
-</li>
-</p>
+<a href="/?q=BlackBerry">BlackBerry</a> (<a href="http://api.duckduckgo.com/?q=BlackBerry&format=json&pretty=1">API example</a>). In the first case (lowercase blackberry) it returns a disambiguation page; in the latter case (MixedCase BlackBerry) it returns info primarily about the device (inferring what you meant from the case).
+
<p style="margin-top: 5px;">
-<li class="small">This API can work over an encrypted (SSL/HTTPS) connection.</li>
-</p>
-</ul>
+<li class="small">This API can work over an encrypted (SSL/HTTPS) connection.
+</ul>
<p style="margin-top: 35px;">
<b>FAQ</b>
-</p>
<p style="margin-top: 10px;">
<i>Are there supporting library integrations?</i>
-</p>
<p style="margin-top: 5px;">
<ul>
<span class="small">
-<li>You can consume this API via <a href="http://www.mashape.com/apis/DuckDuckGo%20Zero-click%20Info">Mashape</a>, which provides PHP, Ruby, Python, Objective-C and Java (including Android) libraries. To do so, <a href="http://www.mashape.com/account/request-alpha-invite?apiName=DuckDuckGo%20Zero-click%20Info">sign up</a> (use the code DUCKDUCK) and <a href="http://www.mashape.com/account/login?apiName=DuckDuckGo%20Zero-click%20Info">login</a>.</li>
-<li><a href="http://search.cpan.org/perldoc?WWW::DuckDuckGo">Perl module</a> & <a href="http://search.cpan.org/perldoc?duckduckgo">command line app</a> by <a href="http://twitter.com/#!/raudssus">@raudssus</a>. </li>
-<li><a href="http://pypi.python.org/pypi/duckduckgo2/0.2">Python library</a> by mikejs. </li>
-<li><a href="http://dhruvbird.com/ddb/zc.html">Zero-click jQuery Search Widget</a> by <a href="http://twitter.com/#!/dhruvbird">@dhruvbird</a> that provides info for you in iframe format. </li>
-<li><a href="https://github.com/SiegfriedEhret/jddg">jddg jQuery plugin</a> [<a href="http://dev.federalbureauofinhumanity.org/jddg/demo/">demo</a>] by <a href="http://federalbureauofinhumanity.org/">Siegfried Ehret</a></li>
-<li><a href="https://github.com/andrewrjones/ruby-duck-duck-go">Ruby Gem</a> by <a href="http://andrew-jones.com/">Andrew Jones</a></li>
-<li><a href="https://github.com/ajanicij/goduckgo">Go library</a> by <a href="https://github.com/ajanicij">ajanicij</a></li>
-<li>If you make another supporting library, we'll add it here!</li>
+<li>You can consume this API via <a href="http://www.mashape.com/apis/DuckDuckGo%20Zero-click%20Info">Mashape</a>, which provides PHP, Ruby, Python, Objective-C and Java (including Android) libraries. To do so, <a href="http://www.mashape.com/account/request-alpha-invite?apiName=DuckDuckGo%20Zero-click%20Info">sign up</a> (use the code DUCKDUCK) and <a href="http://www.mashape.com/account/login?apiName=DuckDuckGo%20Zero-click%20Info">login</a>.
+<li><a href="http://search.cpan.org/perldoc?WWW::DuckDuckGo">Perl module</a> & <a href="http://search.cpan.org/perldoc?duckduckgo">command line app</a> by <a href="http://twitter.com/#!/raudssus">@raudssus</a>.
+<li><a href="http://pypi.python.org/pypi/duckduckgo2/0.2">Python library</a> by mikejs.
+<li><a href="http://dhruvbird.com/ddb/zc.html">Zero-click jQuery Search Widget</a> by <a href="http://twitter.com/#!/dhruvbird">@dhruvbird</a> that provides info for you in iframe format.
+<li><a href="https://github.com/SiegfriedEhret/jddg">jddg jQuery plugin</a> [<a href="http://dev.federalbureauofinhumanity.org/jddg/demo/">demo</a>] by <a href="http://federalbureauofinhumanity.org/">Siegfried Ehret</a>
+<li><a href="https://github.com/andrewrjones/ruby-duck-duck-go">Ruby Gem</a> by <a href="http://andrew-jones.com/">Andrew Jones</a>
+<li><a href="https://github.com/ajanicij/goduckgo">Go library</a> by <a href="https://github.com/ajanicij">ajanicij</a>
+<li>If you make another supporting library, we'll add it here!
</span>
</ul>
-</p>
+
<p style="margin-top: 25px;">
<i>Why is x query blank? Where are all the Web links like on the main site?</i>
-</p>
<p style="margin-top: 5px;">
-<span class="small">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.</span>
-</p>
+<span class="small">This is an instant answer API, and not a full results API. However, there are some Web links within it, e.g. official sites.</span>
+
+
<p style="margin-top: 25px;">
-<i>So is there then another API with all the Web links?</i>
-</p>
+<i>So is there then another API with all the Web links?</i>
<p style="margin-top: 5px;">
-<span class="small">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 <a href="/search_box">search box</a> integration.</span>
-</p>
+<span class="small">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 <a href="/search_box.html">search box</a> integration.</span>
+
<p style="margin-top: 25px;">
-<i>Why is y query blank? I see Zero-click Info on the main site!</i>
-</p>
+<i>Why is y query blank? I see an Instant Answer on the main site!</i>
<p style="margin-top: 5px;">
<span class="small">
-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 <a href="/feedback">let us know</a> and perhaps we can make it happen.
+Not all of our instant answers are available right now via this API for a variety of reasons, though it is our long term goal to make them so. However, if you would like to see something in particular please <a href="/feedback.html">let us know</a>, and perhaps we can prioritize making it happen.
</span>
-</p>
<p style="margin-top: 25px;">
-If you have more questions, please <a href="/feedback">let us know</a>.
-</p>
+If you have more questions, please <a href="/feedback.html">let us know</a>.
View
9 share/site/duckduckgo/duckduckpreview.tx
@@ -6,14 +6,15 @@
<a class="l" href="/">Duck Duck Go</a> is a new search engine. Duck Duck Preview is the server process behind our preview function, which allows users to preview pages before visiting them.
<p style="margin-top: 15px;">
-We grab pages on behalf of our users and display to them parts of those pages most relevant to their queries. Duck Duck Preview is not a Web crawler or spider.
+We grab pages on behalf of our users and display to them parts of those pages most relevant to their queries. Duck Duck Preview is not a Web crawler or spider. </p>
<p style="margin-top: 15px;">
-If you have any questions, please email help@duckduckgo.com.
-
+If you have any questions, please email help@duckduckgo.com.</p>
<p style="margin-top: 30px;">
<i>Changelog</i>
+</p>
<p style="margin-top: 15px;">
-DuckDuckPreview/1.0 - Initial version.
+DuckDuckPreview/1.0 - Initial version.
+</p>
View
14 share/site/duckduckgo/search_box.tx
@@ -27,7 +27,7 @@ pre {
<: l('Feel free to adjust the settings below. Then, just copy and paste the code into your website!') :>
<div style="margin-bottom:30px;"></div>
-<i><: l('Regular search box') :></i>
+<i>Regular search box</i>
<div style="margin-bottom:10px;"></div>
<iframe id="code_frame" src="/search.html" style="overflow:hidden;margin:0;padding:0;width:550px;height:39px;" frameborder="0"></iframe>
<pre id="code">
@@ -37,7 +37,7 @@ pre {
new_code_width = '';
new_code_duck = '';
new_code_spread = '';
-new_code_prefill = '<: js(l('Search DuckDuckGo')) :>';
+new_code_prefill = 'Search DuckDuckGo';
new_code_ssearch = '';
new_code_bgcolor = '';
new_code_focus = '';
@@ -58,8 +58,8 @@ function new_code() {
height = '40px';
if (new_code_duck && new_code_duck=='yes') height = '60px';
- width = 398;
- if (new_code_width) width=parseInt(new_code_width)+48;
+ width = 408;
+ if (new_code_width) width=parseInt(new_code_width)+58;
if (new_code_duck=='yes') width+=75;
else if (new_code_duck=='small') width+=34;
@@ -78,7 +78,7 @@ new_code();
</script>
<span class="clu">
<ul>
-<li>Width: <input type="text" style="width:40px;" onkeyup="new_code_width=this.value;new_code();">px (The example above uses 398 pixels)
+<li>Width: <input type="text" style="width:40px;" onkeyup="new_code_width=this.value;new_code();">px (The example above uses 408 pixels)
<div style="margin-bottom:7px;"></div>
<li>Duck logo:
@@ -87,7 +87,7 @@ new_code();
<!--&nbsp; <input type="radio" name="duck" onchange="if (this.checked) new_code_duck='small'; else new_code_duck='';new_code();"> Small//-->
<div style="margin-bottom:7px;"></div>
-<li>Background Color: #<input type="text" style="width:60px;" onkeyup="new_code_bgcolor=this.value;new_code();"> ex: #000000 (Color Cheet Sheet <a href="https://duckduckgo.com/?q=color+codes">here</a>)
+<li>Background Color: #<input type="text" style="width:60px;" onkeyup="new_code_bgcolor=this.value;new_code();"> ex: #000000 (Color Cheat Sheet <a href="https://duckduckgo.com/?q=color+codes">here</a>)
<!--
<div style="margin-bottom:7px;"></div>
@@ -113,7 +113,7 @@ new_code();
<div style="border:1px solid #000;width:250px;">
<div style="background-color:#000;border:2px solid #FFF;padding:5px;text-align:center;">
<img src="http://duckduckgo.com/nduck.v106.small.png" alt="DuckDuckGo logo"/>
-<div style="color:#fff;font-size:12px;padding:5px;"><: lp('searchbox','DuckDuckGo is a search engine that protects privacy and has lots of features.') :></div>
+<div style="color:#fff;font-size:12px;padding:5px;">DuckDuckGo is a search engine that protects privacy and has lots of features.</div>
<form action="http://duckduckgo.com/">
<input type="text" name="q" style="width:160px;border:1px solid #666;background-color:#000;color:#fff;padding:1px;border-radius:4px;font-size:14px;"/>
<input type="submit" style="background-color:#000;color:#fff;font-size:12px;padding:2px;" value="Search">
Please sign in to comment.
Something went wrong with that request. Please try again.