API Playground
The ForVoyez API playground is an interactive tool in your dashboard that allows you to test the image analysis capabilities of our API. You can upload an image, provide custom context, keywords, and an output language, and specify a JSON schema to customize the structure of the API response. It is the only online tool of the dashboard.
Each analysis in the playground uses 1 credit, like an API request, and appears under "Playground" on the Usage page.
Uploading an Image
To analyze an image using the API playground:
- Click on the "Upload a file" button or drag and drop an image into the designated area.
- The uploaded image should be in PNG, WEBP, JPG, or GIF format and not exceed 10MB in size.
- Once the image is uploaded, it will be displayed in the playground.
Providing Custom Context
You can provide additional context to help the API better understand and process your image. This can include information about the image content, specific requirements, or any other relevant details.
To add custom context:
- In the "Add Your Context (Optional)" section, enter your context in the text area provided.
- The more context you provide, the more accurate the API results will be.
Adding Keywords
In the "Keywords (Optional)" field, enter comma-separated keywords (for example Cat, Dog, Animal) that the generated metadata should include. This is the keywords field of the API.
Choosing the Language
In the "Language (Optional)" field, enter the language of the generated metadata, as a language code such as en, fr, or es. This is the language field of the API; without it, the metadata is in English.
Specifying a JSON Schema
The API playground allows you to customize the structure and format of the API response by specifying a JSON schema. By default, the API will use a standard schema if no custom schema is provided.
To specify a custom JSON schema:
- In the "JSON Schema (Optional)" section, enter your desired schema using valid JSON syntax: a flat object that maps each output field to a description of what to generate (see Data Schemas).
- The JSON schema defines the fields returned by the API; every value is a string.
- The playground shows whether your schema is valid JSON. A schema over the schema limits is rejected without using a credit.
Analyzing the Image
Once you have uploaded an image, provided custom context (optional), and specified a JSON schema (optional), you can analyze the image using the ForVoyez API.
To analyze the image:
- Click on the "Analyze your image" button.
- The API playground will send a request to the ForVoyez API with the uploaded image, context, and JSON schema.
- The API will process the image and generate a response based on the provided inputs.
Viewing the API Response
After the image is analyzed, the API response will be displayed in the "API Response" section of the playground.
The response will include:
- The generated title for the image
- Alternative text describing the image
- A caption providing more context about the image Or any other metadata based on the JSON schema provided.
You can copy the API response by clicking on the copy button located in the top-right corner of the response section.
Request Preview
The "Request Preview" section shows the same request made to the API from your own server, as ready-to-run code in cURL, raw HTTP, JavaScript (Node.js), PHP and Python. It sends the selected image, context, keywords, language and JSON schema as multipart/form-data to POST https://forvoyez.com/api/describe; replace YOUR_API_KEY with one of your API keys. Keep the key on your server: never put it in code that runs in a browser.
You can copy the request preview by clicking on the copy button located in the top-right corner of the preview section.
Next Steps
- Explore the API Documentation to learn more about the available endpoints and parameters.
- If you have any questions or need assistance, reach out to our Support Team.
Start leveraging the power of the ForVoyez API to generate metadata for your images and enhance your application's capabilities!
