The Label Types API lists the different types of labels used in Project Sidewalk, including the name, description, associated icon images, and color codes. For each label, users can also assign one or more optional tags, which provides additional information about the sidewalk feature or barrier.
This Label Types API endpoint is useful for applications that want to display Project Sidewalk data with consistent styling, or for developers who need to understand the classification system used in our other APIs.
Below is a live preview of the primary label types retrieved directly from the API:
Retrieve a list of all label types with their metadata.
GET /v3/api/labelTypes
/v3/api/labelTypes
Get all label types in JSON
Download label types data directly in JSON:
On success, the API returns an HTTP 200 OK
status code and a JSON object containing an array of
label types.
{
"status": "OK",
"labelTypes": [
{
"id": 1,
"name": "CurbRamp",
"description": "Curb ramp connecting sidewalk to street",
"iconUrl": "/assets/images/icons/label_type_icons/CurbRamp.png",
"smallIconUrl": "/assets/images/icons/label_type_icons/CurbRamp_small.png",
"tinyIconUrl": "/assets/images/icons/label_type_icons/CurbRamp_tiny.png",
"color": "#90C31F",
"isPrimary": true,
"isPrimaryValidate": true
},
{
"id": 2,
"name": "NoCurbRamp",
"description": "Missing curb ramp",
"iconUrl": "/assets/images/icons/label_type_icons/NoCurbRamp.png",
"smallIconUrl": "/assets/images/icons/label_type_icons/NoCurbRamp_small.png",
"tinyIconUrl": "/assets/images/icons/label_type_icons/NoCurbRamp_tiny.png",
"color": "#E679B6",
"isPrimary": true,
"isPrimaryValidate": true
},
// ... more label types
]
}
Field | Type | Description |
---|---|---|
status |
string |
Always "OK" for successful responses. |
labelTypes |
array |
Array of label type objects. |
labelTypes[].id |
integer |
Unique identifier for the label type. |
labelTypes[].name |
string |
Name of the label type (e.g., "CurbRamp", "Obstacle"). |
labelTypes[].description |
string |
Human-readable description of the label type. |
labelTypes[].iconUrl |
string |
Path to the standard icon image for this label type. |
labelTypes[].smallIconUrl |
string |
Path to the small icon image for this label type. |
labelTypes[].tinyIconUrl |
string |
Path to the minimap/tiny icon image for this label type. |
labelTypes[].color |
string |
Hex color code (e.g., "#90C31F") associated with this label type. |
labelTypes[].isPrimary |
boolean |
Whether this is a primary label type in the Project Sidewalk system. |
labelTypes[].isPrimaryValidate |
boolean |
Whether this label type is included in primary validation tasks. |
If an error occurs, the API will return an appropriate HTTP status code and a JSON response body containing details about the error.
500 Internal Server Error
: An unexpected error occurred on the server.503 Service Unavailable
: The server is temporarily unable to handle the request (e.g., during maintenance).Error responses include a JSON body with the following structure:
{
"status": 500, // HTTP Status Code
"code": "INTERNAL_SERVER_ERROR", // Machine-readable error code
"message": "Failed to retrieve label types: Database connection error" // Human-readable description
}
Project Sidewalk is an open-source project created by the Makeability Lab and hosted on GitHub. We welcome your contributions! If you found a bug or have a feature request, please open an issue on GitHub.
You can also email us at sidewalk@cs.uw.edu
If you are interested in bringing Project Sidewalk to your city, please read our Wiki page.