🔌API

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()

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 [email protected]

Last updated