Installation
Before you begin, install therequests library if you haven’t already:
Quick start
1
Import required libraries
You’ll need the
requests library for making HTTP requests and json for handling the response data.2
Configure your API request
Set up your payload with the prompt and optional parameters. Replace
YOUR_API_KEY with your actual API key from the cloro dashboard.3
Handle the response
Process the API response by printing it to stdout or saving it to a file.
Complete example
Request parameters
You can 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:Saving responses to files
To save the ChatGPT response to a JSON file:Timeout configuration
Error handling best practices
Implement comprehensive error handling to manage different failure scenarios:Always check the
status field in the response to verify successful execution 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