API Documentation

This section provides a comprehensive reference for the ForVoyez API. You'll find detailed information about the available endpoints, request parameters, response formats, error codes, and error messages. Use this documentation as a guide while integrating the ForVoyez API into your application.

Complete Reference of Endpoints

The ForVoyez API offers the following endpoints:

  • POST /describe: Generate metadata for an image.

For detailed information about each endpoint, including the required parameters, request examples, and response formats, refer to the individual endpoint documentation:

Details of Parameters and Responses

Each endpoint in the ForVoyez API requires specific parameters to be included in the request. These parameters are provided as form fields in a multipart/form-data request.

The API responses are returned in JSON format and contain the requested data or relevant error information. The response format varies based on the endpoint and the success or failure of the request.

Here's an example of a request and response for the /describe endpoint:

curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/your/image.jpg" \
-F "schema={\"title\":\"string\",\"alternativeText\":\"string\",\"caption\":\"string\"}" \
-F "keywords=playful,kittens" \
-F "context=Playful kittens" \
-F "language=en" \
https://forvoyez.com/api/describe

The available parameters for the /describe endpoint are:

  • image: The image file (required)
  • schema: JSON string specifying the desired output format (optional)
  • keywords: Comma-separated list of keywords (optional)
  • context: Additional context about the image (optional)
  • language: Desired language for the output (optional, defaults to 'en')

For more details on the parameters and responses for each endpoint, refer to the individual endpoint documentation.

Error Codes and Error Messages

If a request to the ForVoyez API fails, you'll receive an appropriate HTTP status code along with an error message in the response body. The error message provides more information about the cause of the error and helps you troubleshoot the issue.

Here are the common error codes you might encounter:

  • 400 Bad Request: The request is invalid or missing required parameters.

  • 400 No file uploaded: The image parameter is missing in the request.

  • 400 Invalid image file: The uploaded file is not a valid image format.

  • 400 Invalid schema: The provided schema is invalid or malformed.

  • 400 Invalid language: The provided language code is not supported.

  • 401 Unauthorized: Authentication failed.

  • 401 Unauthorized, missing Authorization header: The Authorization header is missing in the request.

  • 401 Unauthorized, invalid token: The provided API key or token is invalid.

  • 401 Unauthorized, no credit left: The user has insufficient credits to make the request.

  • 429 Too Many Requests: The request limit for your subscription plan has been exceeded.

  • 500 Internal Server Error: An unexpected error occurred on the server side.

The error response body will include an error message with more details:

400 Bad Request
Missing required parameter: image

For a complete list of error codes and their meanings, refer to the Error Codes documentation.

Next Steps

Now that you have a good understanding of the API documentation, you can:

  • Start making requests with the simplified parameter structure
  • Use keywords to improve image analysis accuracy
  • Customize the output format using the schema parameter
  • Handle error codes and messages gracefully in your application
  • If you encounter any issues or have questions, reach out to our support team for assistance.

Happy coding with the ForVoyez API!