A simple API is available for creating vertical files from English and Czech documents. In order to use it, first obtain an API key here. To authenticate, use basic HTTP authentication with your usual user name as username and the API key as password.

The URLs of the API are:

  • https://beta.sketchengine.co.uk/api/make_vertical/english
  • https://beta.sketchengine.co.uk/api/make_vertical/czech

The API accepts multi-part POST requests and expects the uploaded document to be sent as a field named “file”. The format of the document is detected from the Content-Type header if present, otherwise from the file name. Encoding is detected automatically. Supported formats include plaintext, PDF, Microsoft Word documents etc.

The resulting vertical is sent as the body of the HTTP response in UTF-8 encoding.

Python example below:

import requests

URL = 'https://beta.sketchengine.co.uk/api/make_vertical/english'
AUTH = ('john_doe', 'WC27G6QW7DINOSHG1DBNM2EO1KDYCQB4')

with open('example.pdf', 'rb') as fp:
    files = {'file': ('example.pdf', fp)}
    r = requests.post(URL, auth=AUTH, files=files)
print r.text