Página principal      API      Documentación      Demo     


About this API
Basic principles
Request parameters
Server response format
Public and secret API keys
Requests quota
Sites where Pressmon.com API is used

About this API

This REST API returns sentences from the press and literature in different languages which contain given word or words combination allowing you to get examples of use of a word in different contexts.

This may be useful for online dictionaries and other linguistic resources.

At the moment the API allows searching for words in the following text corpora:

  • English
  • Spanish
  • Italian
  • German
  • Russian
  • French

Basic principles

1. Sending a request to server.


(this example contains the minimal set of parameters)

2. Getting a response from server in JSON format and interpreting of the results.

Server requests parameters

qWord or words combination to search for. Mandatory parameter
keyPublic or secret API key. Mandatory parameter
lText corpus language to search in. Possible values:
en - English
es - Spanish
it - Italian
de - German
ru - Russian
fr - French

Default: en
fromRecord number to start with.
Default: 0.
sizeMaximum number of sentences to return.
Default: 10.
Minimal value: 1, maximum value: 100.
formatData format to return results in. Allowed values:
For cross-domain requests with jQuery library you must use jsonp format. Default: json.
gteMinimal sentence length to return. Only sentences shorter than this value will be returned. Default: 0.
lteMaximum sentence length to return. Only sentences larger than this value will be returned. Default: 10000.

You can use from and size parameters for pagination.

Request example with all parameters:
This request tells the API to search for sentences containing the word dictionary in English corpus. Return results in jsonp format, 15 records starting from the 10-th one. Search for sentences not shorter than 150 and not larger than 500 characters.

Server response format

The server returns the results in JSON or JSONP format (depending on the value of format field).
In case of successful request the res field will contain ok, otherwise - error.
In case of error, you can find the error description in the info field.

Parameters returned in server response:
res in case of successful request, error otherwise
infoError description in case of error
quota_dailyDaily requests quota for given API key
quota_daily_usedQuota used today
langText corpus language where the search was performed
timeTime of request execution, in milliseconds
queryText to search for
fromRecord number to start results with
sizeMaximum number of results in server response
gteMimimum sentence length
lteMaximum sentence length
hits Contains the sentences found as records with the following structure:

article_idArticle ID at Pressmon.com
lenCurrent sentence length (number of characters)
countryCountry code of the publication source
sourcePublication source
pub_dayPublication day
pub_monthPublication month
pub_yearPublication year
titleArticle title
bodyText of the sentence found
urlURL of the article containing the sentence found

Example of server response with an error message:
{ "res": "error", "info": "Quota exceeded" }

Example of a successful server response:

"source":"Korean News",
"body":"A new window will open with a dictionary definition or encyclopedia entry. ",
"title":"ELECTION GUIDE 2008 \""
"source":"Korean News",
"body":"The dictionary contains a vocabulary of over 402,000 words. ",


Public and secret API keys

This API provides a public and a secret key. Both keys are available in your account upon registration.

For a public key you can provide a list of domains which are allowed to send requests using this API key. You may use the public key in applications running on the client side where any user can see the key, but it's use is allowed only on certain domains. The secret key can be used on the server side where the key may be used on any domain, but is not available to users.

You can change your keys at any time.

Requests quota

We provide a free quota of 2 000 daily requests. If this limit is exceeded, you will see a "quota exceeded" error message.

You can see in your account how much time is left before the quota is restored.

If you need more quota, please contact us here.

You must provide a link to www.pressmon.com on all pages where the content obtained using this API is displayed.

Examples of links:
Powered by Pressmon.com
Examples by Pressmon.com
Примеры от Pressmon.com
Ejemplos por Pressmon.com

Sites where Pressmon.com API is used

On these sites you can see how our API is used in production:

www.diccionario.ru - Spanish-Russian and Russian-Spanish dictionary
www.diclib.com - Online dictionaries of different languages

Ir a la página principal