POST /api/v1/transform
The transformation endpoint extracts pricing information from a SaaS website URL and converts it into the Pricing2YAML format. This is an asynchronous operation that returns a task ID for status polling.Endpoint Details
URL:http://localhost:8001/api/v1/transform
Method: POST
Content-Type: application/json
Request Body
The full URL of the SaaS pricing page to extract data from.Example:
https://slack.com/pricingThe OpenAI model to use for extraction. Common options:
gpt-5.2(default)gpt-4ogpt-3.5-turbo
Controls randomness in model responses. Range: 0.0 to 1.0
- Lower values (0.0-0.3): More deterministic and focused
- Higher values (0.7-1.0): More creative but less consistent
Maximum number of validation and fixing iterations. The system will attempt to validate and correct the extracted YAML up to this many times.
Custom endpoint URL for OpenAI-compatible APIs. Useful for:
- Self-hosted LLM endpoints
- Azure OpenAI Service
- Other OpenAI-compatible providers
Model to use for higher-quality refinement passes.
Response
The endpoint immediately returns a response with a task ID:Unique identifier for the transformation task. Use this to poll for status and retrieve the result.
Initial status of the task. Will be
"pending" when first created.Human-readable message about the task status.
Example Request
Example Response
Checking Task Status
Use the returnedtask_id to poll for completion:
Endpoint: GET /api/v1/transform/status/{task_id}
Status Response
Current status of the task:
"pending"- Task is queued or in progress"completed"- Task finished successfully"error"- Task failed
Path to the generated YAML file (only present when status is
"completed")Error message if the task failed (only present when status is
"error")Polling Example
Extraction Process
The A-MINT service performs the following steps during transformation:Fetch HTML Content
Uses Selenium WebDriver to load the pricing page and extract rendered HTML.From
src/amint/extractors/web_driver.pyConvert to Markdown
Transforms HTML into structured Markdown using LLM-powered conversion.Normalizes table separators and removes excessive formatting.
Extract Plans
Identifies pricing tiers, costs, and billing cycles.Extracts configuration like currency and billing period.
Extract Features
Identifies features and categorizes them:
- DOMAIN (core functionality)
- INTEGRATION (external services)
- SUPPORT (customer service)
- AUTOMATION (workflow automation)
- GUARANTEE (SLAs, compliance)
- INFORMATION (analytics, reporting)
- MANAGEMENT (admin controls)
Extract Usage Limits
Finds numeric quotas and thresholds:
- RENEWABLE (monthly resets)
- NON_RENEWABLE (permanent limits)
- TIME_DRIVEN (time-based quotas)
Validate & Fix
Iteratively validates the YAML against the Analysis API and fixes errors.Continues up to
max_tries iterations until valid or gives up.Error Handling
Common errors and their meanings:Failed to fetch HTML content
Failed to fetch HTML content
The WebDriver couldn’t load the pricing page. Possible causes:
- Invalid URL
- Website blocking automated access
- Network connectivity issues
- Page requires JavaScript that failed to execute
YAML validation failed after maximum iterations
YAML validation failed after maximum iterations
The extracted YAML couldn’t be validated even after
max_tries attempts. This can happen when:- The pricing page structure is too complex
- The LLM model consistently misinterprets the content
- The page contains ambiguous or inconsistent information
max_tries or using a more capable model.Task not found
Task not found
The provided
task_id doesn’t exist. This can occur if:- The task ID is incorrect
- The task expired (tasks are stored in memory)
- The service restarted
Output Format
When the task completes successfully, the status endpoint returns the YAML file directly with: Content-Type:application/x-yaml
Filename: pricing_{uuid}.yaml
YAML Structure
See the A-MINT Overview for the complete Pricing2YAML specification. The extracted YAML includes:Logging and Debugging
A-MINT logs detailed information during extraction:- Application logs:
/app/logs/amint_api.log - Transformation logs:
/app/logs/transformation_logs.csv
transformation_call_id: Unique ID for the transformationtimestamp: Start timeresponse_time: Total processing time in secondsraw_html_length: Size of original HTMLcleaned_html_length: Size after cleaningllm_call_ids: Comma-separated list of LLM API calls made
Performance Considerations
Factors affecting performance:- Page complexity: More plans and features take longer to extract
- Model speed: Faster models like
gpt-3.5-turboreduce latency - Validation iterations: Complex pages may require many fix attempts
- Network latency: OpenAI API call overhead
- Use a lower
temperature(0.0-0.3) for more deterministic results - Reduce
max_triesif you’re willing to accept partial extractions - Consider caching results for frequently accessed pricing pages
- Use faster models for initial extraction, better models for refinement
Related Endpoints
POST /api/v1/fix
Fix and validate an existing YAML file without re-extracting from HTML
Analysis API
Validate and analyze extracted YAML files
Next Steps
A-MINT Overview
Learn more about A-MINT’s architecture and capabilities
MCP Tools
See how Harvey agent uses iPricing to call A-MINT