Zur Übersicht

URL-Synopsis

   http://api.golem.de/api/article/search/page/itemPerPage/query/?key=developerkey&format=resultformat
   http://api.golem.de/api/article/search/itemPerPage/query/?key=developerkey&format=resultformat
   http://api.golem.de/api/article/search/query/?key=developerkey&format=resultformat
   http://api.golem.de/api/article/search/page/itemPerPage/query/?key=developerkey
   http://api.golem.de/api/article/search/itemPerPage/query/?key=developerkey
   http://api.golem.de/api/article/search/query/?key=developerkey
  

Function

Searches for articles matching the query string.

Arguments

Name Datatype Meaning Default value
page Integer The result "page" to return. 1
itemsPerPage Integer The number of results per "page" to return 10
query String Search query to use Value required
developerkey String A valid developer key Value required
resultformat String The format of the result set (Allowed values: json or xml) json

Returns

The result data is encoded in UTF-8.

Name Datatype Meaning
success Boolean Indicates, wether the request could be successfully handle (true) or not (false).
data Array The list of articles matching the search query, if the request was sucessful
    totalResults Integer The total number of articles matching the search query
    startIndex Integer The used "page" number
    itemsPerPage Integer The used number of results per "page"
    records Array The list if articles matching the search query
errorCode Integer The error code, if the request was not successful
errorMessage String The error message, if the request was not successful

Records Array

The records array represents the list of articles. Each article is represented by a single record. Each record consists of:

Name Datatype Meaning
articleid Integer The article identifier of the article
headline String(60) The headline of the article
abstracttext String The abstract text of the article
url String The URL of the article
date Integer The publishing date of the article

Error codes

Code Meaning
1 Internal Data access error
12 A word in the search query was too short
13 A word in the search query was too long
14 The whole search query is too long
15 The much words in a single search query

Test output with a single resultset as JSON

{"__className":"stdClass","data":{"__className":"stdClass","records":[{"article
id":1,"headline":"Lorem ipsum dolor sit amet consectetuer sadipscing elitr sed"
,"abstracttext":"Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed
 diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, se
 d diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet 
 clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
 ,"url":"http://api.golem.de/","date":1234567890}],"totalResults":1,"startIndex
 ":1,"itemsPerPage":1},"success":true}  
  

Test output with a single resultset as XML

<?xml version="1.0" encoding="UTF-8"?>
<golemderesult>
<success>1</success>
<data>
<records>
<record>
<articleid>1</articleid>
<headline>Lorem ipsum dolor sit amet consectetuer sadipscing elitr sed</headline>
<abstracttext>Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed
diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet.
</abstracttext>
<url>http://api.golem.de/</url>
<date>1234567890</date>
</record>
</records>
<totalResults>1</totalResults>
<startIndex>1</startIndex>
<itemsPerPage>1</itemsPerPage>
</data>
</golemderesult>
  


Zur Übersicht