cURL
curl -X POST https://api.aiql.io/extract \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Report\n\nLong markdown content...", "schema": {"classes": [{"name": "Person", "definition": "An individual human."}], "properties": [{"name": "name", "type": "STRING", "definition": "The person's full name.", "domain": ["Person"]}], "relationships": [{"name": "knows", "definition": "One person is acquainted with another.", "domain": ["Person"], "range": ["Person"]}]}}'import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
records = client.tools.extract(markdown=markdown, schema=schema)import { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const records = await client.tools.extract({ markdown, schema });{
"nodes": [
{
"id": "<string>",
"name": "<string>",
"properties": {}
}
],
"relationships": [
{
"id": "<string>",
"name": "<string>",
"source": "<string>",
"target": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Tools
Extract
POST
/
extract
cURL
curl -X POST https://api.aiql.io/extract \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Report\n\nLong markdown content...", "schema": {"classes": [{"name": "Person", "definition": "An individual human."}], "properties": [{"name": "name", "type": "STRING", "definition": "The person's full name.", "domain": ["Person"]}], "relationships": [{"name": "knows", "definition": "One person is acquainted with another.", "domain": ["Person"], "range": ["Person"]}]}}'import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
records = client.tools.extract(markdown=markdown, schema=schema)import { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const records = await client.tools.extract({ markdown, schema });{
"nodes": [
{
"id": "<string>",
"name": "<string>",
"properties": {}
}
],
"relationships": [
{
"id": "<string>",
"name": "<string>",
"source": "<string>",
"target": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key or UI session JWT passed as a Bearer token.
Body
application/json