API: Web services

/api/v1/ping

Description Returns HTTP code 200, if embedddings.cc is running stable.
URL https://embeddings.cc/api/v1/ping
HTTP method POST or GET
Python code example
import httpx
if httpx.get('https://embeddings.cc/api/v1/ping').status_code == 200:
    print('Status: OK')
Test
Test result

/api/v1/get_indices

Description Gets available indices (databases).
URL https://embeddings.cc/api/v1/get_indices
HTTP method POST
Returns List of available indices, format: JSON
Python code example
import httpx
    response = httpx.post('https://embeddings.cc/api/v1/get_indices')
    if response.status_code == 200:
        print(response.text)
    else:
        print('Error:', response.text)
Test
Test result

/api/v1/get_size

Description Gets number of available entities.
URL https://embeddings.cc/api/v1/get_size
HTTP method POST
Parameter index { optional, format: JSON }
Returns Number of available entities, format: text
Python code example
import httpx
response = httpx.post('https://embeddings.cc/api/v1/get_size')
if response.status_code == 200:
    print(response.text)
else:
    print('Error:', response.text)
Test
Test result

/api/v1/get_random_entities

Description Gets identifiers of example entities.
URL https://embeddings.cc/api/v1/get_random_entities
HTTP method POST
Parameters size { default: 10, max: 100, format: JSON }
index { optional, format: JSON }
Returns List of entity identifiers, format: JSON
Python code example
import httpx
response = httpx.post('https://embeddings.cc/api/v1/get_random_entities', json={'size': 10})
if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.text)
Test
Test input
Test result

/api/v1/get_entities

Description Gets entities, starting from offset.
URL https://embeddings.cc/api/v1/get_entities
HTTP method POST
Parameters size { default: 100, max: 10000, format: JSON }
offset { default: 0, format: JSON }
index { optional, format: JSON }
Returns List of entity identifiers, format: JSON
Python code example
import httpx
response = httpx.post('https://embeddings.cc/api/v1/get_entities', json={'size': 100, 'offset': 0})
if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.text)
Test
Test input
Test result

/api/v1/get_embeddings

Description Takes entity identifiers and gets their embeddings.
URL https://embeddings.cc/api/v1/get_embeddings
HTTP method POST
Parameters entities { value: list of entity identifiers, max: 100, format: JSON }
index { optional, format: JSON }
Returns List of 2-element-lists (entity identifier and embeddings), format: JSON
Python code example
import httpx
response = httpx.post('https://embeddings.cc/api/v1/get_embeddings', json={'entities': ['http://example.org/1', 'http://example.org/2']})
if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.text)
Test
Test input
Test result