curl -X POST https://api.iterationlayer.com/document-extraction/v1/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"type": "url",
"name": "listing.pdf",
"url": "https://example.com/listings/listing.pdf"
}
],
"schema": {
"fields": [
{
"name": "address",
"type": "ADDRESS",
"description": "Full property address"
},
{
"name": "listing_price",
"type": "CURRENCY_AMOUNT",
"description": "Listed sale price"
},
{
"name": "bedrooms",
"type": "INTEGER",
"description": "Number of bedrooms"
},
{
"name": "bathrooms",
"type": "INTEGER",
"description": "Number of bathrooms"
},
{
"name": "square_footage",
"type": "INTEGER",
"description": "Total square footage"
}
]
}
}'{
"success": true,
"data": {
"address": {
"value": {
"street": "1847 Maple Drive",
"city": "Austin",
"region": "TX",
"postal_code": "78704",
"country": "US"
},
"confidence": 0.97,
"citations": [
"1847 Maple Drive, Austin, TX 78704"
]
},
"listing_price": {
"value": {
"amount": "549,000.00",
"currency": "USD"
},
"confidence": 0.98,
"citations": ["Listed at $549,000"]
},
"bedrooms": {
"value": 3,
"confidence": 0.99,
"citations": ["3 Bed"]
},
"bathrooms": {
"value": 2,
"confidence": 0.99,
"citations": ["2 Bath"]
},
"square_footage": {
"value": 1850,
"confidence": 0.96,
"citations": ["1,850 sq ft"]
}
}
}import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.extract({
files: [
{
type: "url",
name: "listing.pdf",
url: "https://example.com/listings/listing.pdf",
},
],
schema: {
fields: [
{
name: "address",
type: "ADDRESS",
description: "Full property address",
},
{
name: "listing_price",
type: "CURRENCY_AMOUNT",
description: "Listed sale price",
},
{
name: "bedrooms",
type: "INTEGER",
description: "Number of bedrooms",
},
{
name: "bathrooms",
type: "INTEGER",
description: "Number of bathrooms",
},
{
name: "square_footage",
type: "INTEGER",
description: "Total square footage",
},
],
},
});
console.log(result);{
"success": true,
"data": {
"address": {
"value": {
"street": "1847 Maple Drive",
"city": "Austin",
"region": "TX",
"postal_code": "78704",
"country": "US"
},
"confidence": 0.97,
"citations": [
"1847 Maple Drive, Austin, TX 78704"
]
},
"listing_price": {
"value": {
"amount": "549,000.00",
"currency": "USD"
},
"confidence": 0.98,
"citations": ["Listed at $549,000"]
},
"bedrooms": {
"value": 3,
"confidence": 0.99,
"citations": ["3 Bed"]
},
"bathrooms": {
"value": 2,
"confidence": 0.99,
"citations": ["2 Bath"]
},
"square_footage": {
"value": 1850,
"confidence": 0.96,
"citations": ["1,850 sq ft"]
}
}
}from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.extract(
files=[
{
"type": "url",
"name": "listing.pdf",
"url": "https://example.com/listings/listing.pdf",
}
],
schema={
"fields": [
{
"name": "address",
"type": "ADDRESS",
"description": "Full property address",
},
{
"name": "listing_price",
"type": "CURRENCY_AMOUNT",
"description": "Listed sale price",
},
{
"name": "bedrooms",
"type": "INTEGER",
"description": "Number of bedrooms",
},
{
"name": "bathrooms",
"type": "INTEGER",
"description": "Number of bathrooms",
},
{
"name": "square_footage",
"type": "INTEGER",
"description": "Total square footage",
},
]
},
)
print(result){
"success": true,
"data": {
"address": {
"value": {
"street": "1847 Maple Drive",
"city": "Austin",
"region": "TX",
"postal_code": "78704",
"country": "US"
},
"confidence": 0.97,
"citations": [
"1847 Maple Drive, Austin, TX 78704"
]
},
"listing_price": {
"value": {
"amount": "549,000.00",
"currency": "USD"
},
"confidence": 0.98,
"citations": ["Listed at $549,000"]
},
"bedrooms": {
"value": 3,
"confidence": 0.99,
"citations": ["3 Bed"]
},
"bathrooms": {
"value": 2,
"confidence": 0.99,
"citations": ["2 Bath"]
},
"square_footage": {
"value": 1850,
"confidence": 0.96,
"citations": ["1,850 sq ft"]
}
}
}package main
import (
"fmt"
il "github.com/iterationlayer/sdk-go"
)
func main() {
client := il.NewClient("YOUR_API_KEY")
result, err := client.Extract(il.ExtractRequest{
Files: []il.FileInput{
il.NewFileFromURL("listing.pdf", "https://example.com/listings/listing.pdf"),
},
Schema: il.ExtractionSchema{
"address": il.NewAddressFieldConfig(
"address", "Full property address",
),
"listing_price": il.NewCurrencyAmountFieldConfig(
"listing_price", "Listed sale price",
),
"bedrooms": il.NewIntegerFieldConfig(
"bedrooms", "Number of bedrooms",
),
"bathrooms": il.NewIntegerFieldConfig(
"bathrooms", "Number of bathrooms",
),
"square_footage": il.NewIntegerFieldConfig(
"square_footage", "Total square footage",
),
},
})
if err != nil {
panic(err)
}
fmt.Println(result)
}{
"success": true,
"data": {
"address": {
"value": {
"street": "1847 Maple Drive",
"city": "Austin",
"region": "TX",
"postal_code": "78704",
"country": "US"
},
"confidence": 0.97,
"citations": [
"1847 Maple Drive, Austin, TX 78704"
]
},
"listing_price": {
"value": {
"amount": "549,000.00",
"currency": "USD"
},
"confidence": 0.98,
"citations": ["Listed at $549,000"]
},
"bedrooms": {
"value": 3,
"confidence": 0.99,
"citations": ["3 Bed"]
},
"bathrooms": {
"value": 2,
"confidence": 0.99,
"citations": ["2 Bath"]
},
"square_footage": {
"value": 1850,
"confidence": 0.96,
"citations": ["1,850 sq ft"]
}
}
}