This page provides links to various API scripts that show how the Sketch Engine can be accessed automatically.

Example – Corpus Architect authentication and JSON

This example will show you how to access the Sketch Engine API through the Corpus Architect (at and get frequencies for a list of CQL queries by the means of JSON (compare to http authenticated version below). When querying our servers (*, please run only one query at once and wait 10 seconds before you run another query.

(the java version needs a module for JSON parsing and a non-standard org.apache.commons.httpclient module)

Example in Java (use attached file not-yet-commons-ssl-0.3.11.jar)

Example in Python 2.7 and in Python 3

Examples – Basic http authentication and JSON

This example demonstrates how to get a list of frequencies from a list of CQL queries. Using the basic http authentication (it is common for local installations but not compatible with the server) and JSON query (compare to the CA auth version above).

Examples to get a list frequencies from a list of CQL queries (Java and Python 2.7)

The following example presents an easy way how to convert usual structures (dictionaries for Python, Maps for Java) to JSON objects and how to use the obtained JSON objects as a query to Sketch Engine. Available for Java and Python.

Examples to convert usual structures to JSON (Java and Python 2.7)

This example presents how to connect the Sketch Engine service on your server using Basic http authentication (it will not work for, CA auth), send a query (in this particular case simple word list query without JSON) and parse the result for JSON syntax. Note that many modules for JSON parsing are available, you do not have to use the one from the examples.

Examples to connect the Sketch Engine service (Java and Python 2.7)

Minimalistic example – no authentication, no JSON parsing

This example shows bare bones of getting results from the Sketch Engine without any authentication or parsing overhead.

Example in Java

Example in Python 2.7

Back to the API signpost