Single query

This function works the same way as the search function on the Keyword Research website. A query string containing a search term is sent to the database which returns a list of search term combinations containing the original search term, along with the total number of searches, and the number of monthly searches. The query can be customized to return subsets of data via the parameters outlined below. The single query function is available at the URL:
http://api.keyworddiscovery.com/query.php

Parameters:

  • Query - The search term to perform the query on.
  • Phrase match - Phrase match query of the search term.
  • Offset - The results number at which to start returning records from.
  • Limit - The maximum number of results to return.
  • Compact results - Returns results with abbreviated fieldname descriptions.
  • Database - Performs a search on a specific keyword database.
  • Exclude - Excludes specified keywords from the results.
  • Plurals - Returns both singular and the plural for the keyword queried.
  • Show total - Shows the total results found from the current query.
  • Show query total - Shows the total number of results for each item in the result set.
  • Multiple queries - Check search counts of 10 search terms at a time.
  • Spell - Returns misspellings.
  • Top 15 query - Returns the top 15 results for up to 10 search terms at a time.
  • Monthly search counts - Provides a monthly break down of search counts per search phrase.

Testing and Admin


Query string/search term (required)
Parameter name: query
Aliases: q, search
Description: The search term to perform the query on.
Example: The following query returns results for the phrase airport parking:
http://api.keyworddiscovery.com/query.php?query=airport+parking

Phrase Match
Default: no
Values: keyword within quotation marks.
Description: Returns results in the exact order of the phrase queried. E.g. a query for "airport parking" will only return keywords with "airport parking" within the phrase and in that order, not "parking airport".
Note: Each phrase query uses two API credits, as opposed to a single API credit in a standard query.
Example: The following query returns a phrase match for airport parking:
http://api.keyworddiscovery.com/query.php?query="airport parking"

Results

Results are returned as XML. A simple HTTP GET example:

http://api.keyworddiscovery.com/query.php?query=airport+parking&offset=10&limit=15&show_total=yes

This request is for the search term "airport parking", the query will display data starting from the 10th result, and a maximum of 15 results will be returned. By default, compact result display is turned on. The XML returned from this query is shown below:

<results compact="true" maximum="15" offset="10" query="airport parking" total_found="6019">
  <r m="346" q="seattle airport parking" t="206"/>
  <r m="346" q="newcastle airport parking" t="206"/>
  <r m="330" q="parking at philadelphia airport" t="197"/>
  <r m="325" q="newark airport parking" t="194"/>
  <r m="315" q="midway airport parking" t="188"/>
  <r m="290" q="bcp parking gatwick airport" t="173"/>
  <r m="289" q="dfw airport parking" t="172"/>
  <r m="278" q="phoenix airport parking" t="166"/>
  <r m="272" q="airport parking coupons" t="162"/>
  <r m="260" q="airport discount parking philadelph" t="155"/>
  <r m="258" q="san diego airport parking" t="154"/>
  <r m="257" q="logan airport parking" t="153"/>
  <r m="255" q="birmingham airport parking" t="152"/>
  <r m="250" q="parking glasgow airport" t="149"/>
  <r m="240" q="airport parking in philadelphia" t="143"/>
</results>

http://api.keyworddiscovery.com/query.php?query="airport parking"

This is a phrase match query for the search term "airport parking". By default, compact result display is turned on. The XML returned from this query is shown below:

<results compact="true" maximum="10" offset="0" query="airport parking">
  <r m="5497" q="airport parking" t="3277"/>
  <r m="864" q="manchester airport parking" t="515"/>
  <r m="631" q="orlando airport parking" t="376"/>
  <r m="421" q="laguardia airport parking" t="251"/>
  <r m="413" q="bristol airport parking" t="246"/>
  <r m="403" q="seatac airport parking" t="240"/>
  <r m="401" q="tampa airport parking" t="239"/>
  <r m="401" q="philadelphia airport parking" t="239"/>
  <r m="376" q="tucson airport parking" t="224"/>
  <r m="351" q="atlanta airport parking" t="209"/>
</results>

Each result is returned as an 'r' tag with the following attributes

  • q - query string
  • t - total search
  • m - monthly estimate. (takes into account a percentage of data that Keyword discovery has in relation to the total number searches done world wide.)



NOTE: Data provided on a URL has to be correctly URL encoded.




< How to access the API | Offset >