API Quickstart
Getting Started with the Unize AI API for developers.
Base URL
All API requests are made to the following base URL:
Unize API Key
The Unize API uses API keys for authenticating requests. Here is a step-by-step guide on how to generate an API Key:
Step 1: Create an account To begin accessing Unize AI, you have to create an API account first. You can sign up for an account here. After signing up, you must verify your account by following the verification link in your email. You will be asked to create a password for your account.
Step 2: Generate an API Key To use the Unize API, you need an API key. You can generate an API key by navigating to the API Keys page and clicking on the “Create New Secret Key” button. You will be asked to provide a name for your API key. After providing a name, click on the “Create” button.
Keep a copy of your API key in a secure place. Do not share it with anyone!
Generating a Knowledge Graph
Once you have your API key and a positive credit balance, you can start generating knowledge graphs.
When generating a knowledge graph by providing input text, you need to make a POST
request to the /api/graph/
endpoint. The request requires the following parameters: api_key
, documents.text
, and documents.source_title
.
Here is an example of how to create a knowledge graph from text using Python:
The response will contain an execution_id
which you can use to visualize the graph or export it as Cypher or JSON.
The execution_id
is a unique identifier for the generated graph. If you want to update an existing graph with new data, you can use the generated execution_id
for that existing graph the next time you make a request to the /api/graph/
endpoint.
Exporting a Knowledge Graph
Once you have the execution_id
of the generated graph, you can export the graph by making a POST
request to the /api/graph/data/
endpoint. The request requires the following parameters: api_key
and execution_id
.
The cypher_query
parameter is optional. If set to FALSE
, the API will return JSON, and if set to TRUE
, the API will return Cypher.
Here is an example of how to export a graph using Python:
The sample request above will return the nodes and relationships of the generated graph. Here is an example of the response:
Visualizing the Generated Knowledge Graph
If you set the cypher_query
parameter when calling the POST api/graph/data/
endpoint to TRUE
, the Unize API will return the Cypher generated from processing your text. One way to visualize the graph is by using Neo4j’s AuraDB service. Copy the Cypher and paste it into your AuraDB instance to visualize the graph.
If you don’t have a Neo4j AuraDB instance, you can create one by following the steps outlined on the Neo4j AuraDB page.