⚡
Structize AI
  • 👋Welcome to Structize AI, a trusted AI platform dedicated to Finance.
  • ⚡Struct Configuration
  • 🔌API
  • ❔Get Support
  • Trust Center
    • Information Security
    • Data Privacy & GDPR
Powered by GitBook
On this page

API

PreviousStruct ConfigurationNextGet Support

Last updated 10 months ago

To access your struct via API you can use the Structize API interface.

You can access the API via https://api.structize.com

You will need an api_key and the id of your struct struct_id to use the API. The api_key can be generated in the settings. Just click on your name in the bottom left and click settings. In the settings you can create an Access Token which can be used as the api_key.

The struct_id is the last 24 characters of the URL when you configure your struct.

Here is a short code example in both Python and JavaScript:

import requests

api_key = ""
struct_id = ""

struct_response = requests.post(
    url="https://api.structize.com/extract",
    headers={"x-api-key": api_key},
    json={
        "structId": struct_id,
        "text": "Your text goes here...",
        # Optional meta_data
        "meta_data": {
            "some_key": "your_optional_meta_data_you_want_in_the_repy_message",
        },
    },
).json()
const apiKey = "";
const structId = "";

const response = fetch("https://api.structize.com/extract", {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "x-api-key": apiKey
    },
    body: JSON.stringify({
        structId: structId,
        text: "Your text goes here...",
        // Optional meta_data
        meta_data: {
            some_key: "your_optional_meta_data_you_want_in_the_reply_message",
        }
    })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

The meta_data is an optional field and can be left out.

After about 10 seconds or up to several minutes for large structs you should receive the output in the following format:

{
  "status": "done",
  "rationale": {
    "tag_1": "rationale_for_the_answer_to_question_1",
    "tag_2": "rationale_for_the_answer_to_question_2",
    ...
  },
  "struct": {
    "tag_1": answer_to_question_1,
    "tag_2": answer_to_question_2,
    ...
  },
  "meta_data": {
      "some_key": "your_optional_meta_data_you_want_in_the_reply_message",
  }
}

If you have any issues, don't hesitate to use the chat in the platform or to reach out to us on support@structize.com

🔌