Installation
Install theaxios HTTP client library:
Quick start
1
Import axios
Import the axios library at the top of your file.
2
Configure your request payload
Set up your payload with the prompt and optional parameters. Replace
YOUR_API_KEY with your actual API key from the cloro dashboard.3
Make the API request
Send a POST request to the API endpoint and handle the response.
Complete examples
Request parameters
Customize your API request using these parameters:The
prompt parameter is mandatory. All other parameters are optional.Handling the response
The API returns a JSON object with the following structure:Async/await pattern
Timeout configuration
Error handling best practices
Implement robust error handling to manage different failure scenarios:Promise vs async/await
You can use either promises or async/await depending on your preference:Always verify the
status field in the response is "success" before accessing the result data.Next steps
- Explore the API reference for detailed endpoint documentation
- Learn about shopping card extraction for e-commerce data
- Check out advanced features like query fan-out insights