Endpoint
Request
Path Parameters
The category for which to retrieve available units. Valid categories are:
temperatura- Temperature unitslongitud- Length/distance unitspeso- Weight/mass unitsvelocidad- Speed/velocity units
Request Examples
Response
Success Response (200 OK)
A comma-separated string containing all available units for the specified category.The format is:
"unit1, unit2, unit3, ..."Examples by Category
Error Responses
400 Bad Request - Invalid Category
400 Bad Request - Invalid Category
Returned when an unsupported or invalid category is requested.This error originates from the ICE server’s
UnidadInvalidaException.503 Service Unavailable - Server Disconnected
503 Service Unavailable - Server Disconnected
500 Internal Server Error
500 Internal Server Error
Returned when an unexpected error occurs.
Frontend Usage
While the frontend currently uses hardcoded unit lists (app.js:2-7), this endpoint can be used to dynamically retrieve available units from the server:The API returns units as a comma-separated string. You’ll need to split it into an array for most frontend use cases.
Unit Labels and Display Names
The API returns internal unit identifiers (e.g.,kmh, mph). The frontend maintains a separate mapping for user-friendly display labels (app.js:10-15):
Implementation Details
This endpoint calls the ICE server’s
unidadesDisponibles() method (web_server.py:149), which returns the available units for the requested category.Use Cases
Dynamic Unit Discovery
Use this endpoint to build dynamic user interfaces that adapt to available units:Validation
Verify that user input contains valid units before submitting a conversion request:API Documentation Generation
Query all categories to generate comprehensive documentation:Response Format Considerations
Related Endpoints
Convert Units
Use the units to perform conversions
API Overview
Learn about all available categories