Developer tools

Here you have simple examples of requests to the Topics Extraction API. You can use them to test a sample request and get an example response in a quick and easy way, right in your favorite programming language.

import requests

url = "https://api.meaningcloud.com/topics-2.0"

payload={
    'key': 'YOUR API KEY',
    'txt': 'YOUR TEXT HERE',
    'lang': 'TEXT LANGUAGE HERE',  # 2-letter code, like en es fr ...
    'tt': 'a'                      # all topics
}

response = requests.post(url, data=payload)

print('Status code:', response.status_code)
print(response.json())
curl 'https://api.meaningcloud.com/topics-2.0' \
    -F 'key=YOUR API KEY' \
    -F 'txt=YOUR TEXT HERE' \
    -F 'lang=TEXT LANGUAGE HERE' \
    -F 'tt=a'
const formdata = new FormData();
formdata.append("key", "YOUR API KEY");
formdata.append("txt", "YOUR TEXT HERE");
formdata.append("lang", "TEXT LANGUAGE HERE");  // 2-letter code, like en es fr ...
formdata.append("tt", "a");                     // all topics

const requestOptions = {
  method: 'POST',
  body: formdata,
  redirect: 'follow'
};

const response = fetch("https://api.meaningcloud.com/topics-2.0", requestOptions)
  .then(response => ({
    status: response.status, 
    body: response.json()
  }))
  .then(({ status, body }) => console.log(status, body))
  .catch(error => console.log('error', error));
<?php

use GuzzleHttp\Client;

$client = new GuzzleHttp\Client();

$response = $client->post('https://api.meaningcloud.com/topics-2.0', [
    'multipart' => [
        [
            'name'     => 'key',
            'contents' => 'YOUR API KEY'
        ],
        [
            'name'     => 'txt',
            'contents' => 'YOUR TEXT HERE'
        ],
        [
            'name'     => 'lang',
            'contents' => 'TEXT LANGUAGE HERE'  # 2-letter code, like en es fr ...
        ],
        [
            'name'     => 'tt',
            'contents' => 'a'                   # all topics
        ]        
    ]
]);

$status = $response->getStatusCode();
$body = json_decode($response->getBody()->getContents(), true);

SDKs

You can find MeaningCloud's SDK for Python, Java/Scala and PHP in our Github page, and published in public repositories:

Not enough? You can also check out TailorBrands' Ruby Wrapper and Kiko Beats' Nodejs client. And of course, if you create your own integration in any other language, we'd love to hear about it!