Tutorials
Structured Output Guide
How to take advantage of Structured Outputs
Linkup’s structured output feature allows you to receive responses in a custom format that you define. This is particularly useful when you need to integrate Linkup’s responses directly into your application’s data structure or when you want to ensure consistency in the response format.
How It Works
To use structured outputs:
- Set
outputType
tostructured
in your API request - Provide a JSON schema in the
structuredOutputSchema
parameter - The API will return a response that strictly follows your schema
Basic Example
Let’s start with a simple example that extracts company classification information:
Example response:
Advanced Example: Competitive Analysis
This example shows how to extract structured competitive analysis information:
Example response:
Best Practices
-
Schema Design:
- Keep your schema as simple as possible while meeting your needs
- Add descriptions to the fields to limit ambiguity
- Use appropriate data types (string, number, boolean, etc.)
- When in doubt, refer to the JSON documentation
-
Query Formulation:
- Write your query so that the answer to it should contain the information requested in the structured output- the system will use the query response to fill the output
- Provide clear context in your query and use explicit instructions
Common Use Cases
- Company classification and categorization
- Competitive analysis
- Market research
- Product comparisons
- Company performance assessments
Facing issues? Reach out to our engineering team at support@linkup.so