📋 Textly / Text Extraction
Obtain structured information about a text
About Texly Text Extraction
Textly allows you to obtain a JSON structured object on a natural language text regardless of the language.
This way you will be able to understand for sure if a text includes something you want to detect.
Usage
Once we have created and configured our API object, it is quite simple, we just need to execute the following code.
import DymoAPI from "dymo-api";
const dymo = new DymoAPI({
apiKey: "PRIVATE_TOKEN_HERE"
});
console.log(await dymo.extractWithTextly({
data: "Javier is 17 years old and studies computer science at university.",
format: {
name: { type: "string" },
age: { type: "number" },
isStudent: { type: "boolean" },
courses: {
type: "array",
items: { "type": "string" }
}
}
}));
Response
Textly uses AI and advanced algorithms for recognition so responses may take a little longer than usual.
{
name: "Javier",
age: 17,
isStudent: true,
courses: [
"computer science"
]
}
Parameters
Authorization
String
required
| Parameter | Type | Required | Description |
|---|---|---|---|
data | String | ✅ | Input text |
format | Format | ✅ | Output scheme |
Types
Format
The maximum number of parameters of the scheme is 50.
Format must be a JSON object where the expected data type is indicated in objects.
And for the internal structure of format (each property inside format):
| Property | Type | Required | Description |
|---|---|---|---|
type | "string" | "number" | "boolean" | "array" | "object" | ✅ | Data type of the property |
items | JsonSchemaProperty | ❌ | Schema for array items (if type is "array") |
properties | Record<string, JsonSchemaProperty> | ❌ | Schema for nested object properties (if type is "object") |
required | String[] | ❌ | List of required property names |
description | String | ❌ | Description of the property |
format | String | ❌ | Data format hint (e.g., date-time, email) |
enum | Unknown[] | ❌ | Allowed values |
minimum | Number | ❌ | Minimum numeric value |
maximum | Number | ❌ | Maximum numeric value |
minLength | Number | ❌ | Minimum string length |
maxLength | Number | ❌ | Maximum string length |
pattern | String | ❌ | Regex pattern string |