You can get way attributes using the Street Attributes API by sending an HTTP GET request to the V2 way-attributes method (REST).
The following example shows the URL of a REST request to the way-attributes method:
https://dplace-api.themap.world/street-attributes/v2/ways/way-attributes?latitude={latitude}&longitude={longitude}&apikey={YOUR_API_KEY}
Include the GPS coordinate and your API key in the query parameters.
The following code shows how to construct a way-attributes request. In this example, you set the GPS coordinate to search from, and also specify:
latitudefor the GPS latitude, between-90and90longitudefor the GPS longitude, between-180and180
BASE_URL="https://dplace-api.themap.world"
curl --request GET \
--url "${BASE_URL}/street-attributes/v2/ways/way-attributes" \
--get \
--data-urlencode "latitude=10.8008266" \
--data-urlencode "longitude=106.7528268" \
--data-urlencode "apikey=<YOUR_API_KEY>" \
--header "Accept: application/json"| Parameter | Type | Required | Description |
|---|---|---|---|
latitude | float | Yes | GPS latitude. Must be between -90 and 90. |
longitude | float | Yes | GPS longitude. Must be between -180 and 180. |
apikey | string | Yes | A valid Digime API key passed as a query parameter. |
{
"status_code": 200,
"message": "Found way attributes near the provided coordinates",
"data": {
"street_name": "Mai Chí Thọ",
"coordinates": [
[
10.8028964,
106.7532309
],
[
10.8011736,
106.7529096
],
[
10.8007751,
106.7528678
]
],
"max_speed": 60,
"attributes": [
{
"label": "p124a",
"name": "Cấm quay xe",
"type": "traffic_signs",
"lat": 10.8015203,
"lng": 106.7529286,
"category": "prohibition",
"subcategory": "turning_restriction",
"heading": "to",
"rules_payload": []
},
{
"label": "p106b",
"name": "Cấm xe tải ",
"type": "traffic_signs",
"lat": 10.8013063,
"lng": 106.7528887,
"category": "prohibition",
"subcategory": "physical_restriction",
"heading": "to",
"rules_payload": [
{
"physical_limits": {
"weight": {
"max": 3.5,
"unit": "ton"
}
},
"lane_index": 0,
"speed_limit_max": null,
"speed_limit_min": null,
"vehicle_code": [
"truck"
],
"lane_div": null,
"turn_lanes": null
}
]
},
{
"label": "p127c",
"name": "Biển ghép tốc độ tối đa cho phép theo phương tiện, trên từng làn đường",
"type": "traffic_signs",
"lat": 10.8008266,
"lng": 106.7528268,
"category": "prohibition",
"subcategory": null,
"heading": "to",
"rules_payload": [
{
"change_lanes": "yes",
"lane_index": 1,
"speed_limit_max": 50,
"speed_limit_min": null,
"vehicle_code": [
"bus_coach",
"passenger_auto"
],
"lane_div": "dashed",
"turn_lanes": null
},
{
"change_lanes": "yes",
"physical_limits": {
"weight": {
"max": 3.5,
"unit": "ton"
}
},
"lane_index": 1,
"speed_limit_max": 50,
"speed_limit_min": null,
"vehicle_code": [
"truck"
],
"lane_div": "dashed",
"turn_lanes": null
},
{
"change_lanes": "yes",
"lane_index": 2,
"speed_limit_max": 50,
"speed_limit_min": null,
"vehicle_code": [
"moto",
"bicycle",
"moped",
"bus_coach",
"passenger_auto"
],
"lane_div": "dashed",
"turn_lanes": null
},
{
"change_lanes": "yes",
"physical_limits": {
"weight": {
"max": 3.5,
"unit": "ton"
}
},
"lane_index": 2,
"speed_limit_max": 50,
"speed_limit_min": null,
"vehicle_code": [
"truck"
],
"lane_div": "dashed",
"turn_lanes": null
},
{
"change_lanes": "yes",
"lane_index": 3,
"speed_limit_max": 50,
"speed_limit_min": null,
"vehicle_code": [
"moto",
"bicycle",
"moped",
"cargo_bicycle",
"auto_rickshaw",
"3wm",
"rickshaw"
],
"lane_div": null,
"turn_lanes": null
},
{
"change_lanes": "yes",
"lane_index": 3,
"speed_limit_max": null,
"speed_limit_min": null,
"vehicle_code": [
"auto_rickshaw"
],
"lane_div": null,
"turn_lanes": null
}
]
}
]
},
"request_id": "42f25c7f-91e9-4cdb-85fd-2639b82a0f49"
}Most signs have no lane-specific conditions at all, so rules_payload is []:
{
"label": "p131a",
"name": "Cấm đỗ xe",
"type": "traffic_signs",
"lat": 10.7697208,
"lng": 106.7030306,
"category": "prohibition",
"subcategory": "stopping_parking",
"heading": "to",
"rules_payload": []
}These two rules aren't merged into one vehicle_code array because their physical_limits differ (a bus seat limit vs. a truck weight limit):
{
"label": "p107",
"name": "Cấm ô tô khách và ô tô tải",
"category": "prohibition",
"subcategory": "vehicle_restriction",
"heading": "from",
"rules_payload": [
{
"physical_limits": {
"seats": { "max": 25, "unit": "seat" }
},
"access_restrictions": {
"valid_time": [
{ "days_of_week": ["all"], "start_time": "06:00", "end_time": "08:00" },
{ "days_of_week": ["all"], "start_time": "11:00", "end_time": "13:00" },
{ "days_of_week": ["all"], "start_time": "17:00", "end_time": "19:00" }
]
},
"lane_index": 0,
"speed_limit_max": null,
"speed_limit_min": null,
"vehicle_code": ["bus_coach"],
"lane_div": null,
"turn_lanes": null
},
{
"physical_limits": {
"weight": { "max": 2.5, "unit": "ton" }
},
"access_restrictions": {
"valid_time": [
{ "days_of_week": ["all"], "start_time": "06:00", "end_time": "08:00" },
{ "days_of_week": ["all"], "start_time": "11:00", "end_time": "13:00" },
{ "days_of_week": ["all"], "start_time": "17:00", "end_time": "19:00" }
]
},
"lane_index": 0,
"speed_limit_max": null,
"speed_limit_min": null,
"vehicle_code": ["truck"],
"lane_div": null,
"turn_lanes": null
}
]
}When a rule applies to all vehicles, vehicle_code is expanded to the full list of vehicle classes rather than a single "all" value:
{
"label": "p130",
"category": "prohibition",
"subcategory": "stopping_parking",
"heading": "from",
"rules_payload": [
{
"access_restrictions": {
"valid_time": [
{ "days_of_week": ["all"], "start_time": "06:00", "end_time": "22:00" }
]
},
"lane_index": 0,
"speed_limit_max": null,
"speed_limit_min": null,
"vehicle_code": ["auto", "moto", "truck", "bus_local", "bus_coach", "trailer", "sm-trailer", "tractor", "bicycle", "moped", "cargo_bicycle", "auto_rickshaw", "3wm", "rickshaw", "peds", "hand_cart", "taxi", "passenger_auto"],
"lane_div": null,
"turn_lanes": null
}
]
}| Field | Type | Description |
|---|---|---|
status_code | integer | Application-level result code. Always 200 for this endpoint — validation and rate-limit errors use a different HTTP status and a different response body. See HTTP responses. |
message | string | A short description of the result. For this endpoint it's always one of: Found way attributes near the provided coordinates (when data is populated) or No way found near the provided coordinates (when data is null). |
request_id | string | Identifier used to trace the request, for example 42f25c7f-91e9-4cdb-85fd-2639b82a0f49. |
data | object/null | The nearest way attributes. In practice null is rare: the lookup has no distance cutoff, so it returns the closest road it can find in the map data even if that road is far from the coordinate you sent. Always check that the returned coordinates are actually close to your query point before trusting the result. |
data fields:
| Field | Type | Description |
|---|---|---|
street_name | string/null | Street name of the nearest way, for example Mai Chí Thọ, Pasteur, or Võ Văn Kiệt. Can also be a bare route number, such as "51", for national highways that have no local name. Returns null when no name is recorded for that road — this is common, so always handle the null case. |
coordinates | array | Ordered geometry of the nearest way, as [latitude, longitude] pairs — the opposite order from GeoJSON's [longitude, latitude]. Returns [] when the geometry can't be resolved. |
max_speed | integer | Speed limit for the way, in km/h, for example 40, 50, 60, or 80. |
attributes | array | Traffic signs associated with the nearest way. Returns [] when the way has no signs — most road segments have none. By default, a sign whose access_restrictions.valid_time doesn't cover the current time (in Vietnam local time) is left out of attributes entirely — the same coordinate can return a different set of signs depending on when you call the API. |
Each item in attributes describes one traffic sign:
| Field | Type | Description |
|---|---|---|
name | string | Display name of the traffic sign, for example Cấm quay xe or Tốc độ tối đa cho phép. |
type | string | Attribute type; always traffic_signs. |
lat | number | Traffic-sign latitude, for example 10.8015203. |
lng | number | Traffic-sign longitude, for example 106.7529286. |
category | string | Normalized traffic-sign category. See the category table below. |
subcategory | string/null | Normalized traffic-sign subcategory. Returns null when no subcategory applies. See the label definition table below. |
label | string | Traffic-sign code, for example p127, p106a, or dp135. See the label definition table below for the full list. |
heading | string | Direction the sign faces, relative to the road's digitized direction: to, from, or (rarely) both. |
rules_payload | array | Lane-specific rules. Returns [] when the sign has no lane-level conditions — most signs (for example a plain no-parking sign) apply everywhere with no extra conditions. Treat each item as an open set of key/value pairs rather than a fixed schema: occasional extra fields from the source map data may pass through unchanged. |
| HTTP status | Meaning | Description |
|---|---|---|
200 | OK | The request was accepted. data contains the nearest way, or null when no way is found. |
400 | Bad Request | The request is malformed before it can be validated. |
401 | Unauthorized | apikey query parameter is missing or invalid. The message text differs by cause — see the examples below. |
422 | Validation Error | A required query parameter is missing or invalid, for example latitude outside -90..90 or longitude outside -180..180. |
429 | Too Many Requests | You've exceeded the request-rate limit. Wait and retry. |
Error responses (400, 401, 422, 429) don't use the same {status_code, message, data, request_id} envelope as a 200 response — check the HTTP status code first, then parse the body accordingly.
The response shape is the same whether apikey is missing or invalid, but message differs:
Missing apikey:
{
"message": "No API key found in request",
"request_id": "bcfe1e1ce5c4686435b1c10d93b6172e"
}Present but invalid apikey:
{
"message": "Unauthorized",
"request_id": "2ff6e06f79e67c4d965c7d27dbb13532"
}| Field | Type | Description |
|---|---|---|
message | string | Unauthorized message. No API key found in request when apikey is missing, Unauthorized when it's present but not valid. |
request_id | string | Identifier of the request, useful for troubleshooting. |
Returned when a query parameter is missing or out of range:
{
"detail": [
{
"loc": ["query", "latitude"],
"msg": "Expected `float` <= 90.0"
}
]
}| Field | Type | Description |
|---|---|---|
detail | array | One item per invalid or missing parameter. |
detail[].loc | array | Location of the offending value, for example ["query", "latitude"]. |
detail[].msg | string | Human-readable validation error. |
{
"detail": "Rate limit exceeded. Please retry later."
}| Field | Type | Description |
|---|---|---|
detail | string | Rate-limit error message. |
| Value | Definition |
|---|---|
end_of_prohibition | End of a prohibition or restriction. |
information | Provides road, lane, direction, or service information. |
mandatory | Indicates an action or direction that road users must follow. |
prohibition | Prohibits or restricts a road-user action. |
expressway_information | Provides information specific to an expressway. |
internal_definition | Internal definition used by the Street Attributes data model. |
warning | Warns road users or identifies a restricted manoeuvre or vehicle type. |
Speed-sign definitions keep their category value, for example p127 is prohibition, dp134 is end_of_prohibition, and r306 is mandatory. Lane-specific speed values are returned as speed_limit_max or speed_limit_min inside rules_payload.
The API returns the API value in the subcategory field.
| API value | Labels | Definition |
|---|---|---|
stopping_parking | p130, p131a, p131b, p131c | Stopping and parking restriction |
turning_restriction | p136, p139, p124b, p103b, p124ap123b, p124d, p124e, p124f, p138p103c, p123a, p124c, p137, p102 | Turning restriction |
vehicle_restriction | p101, p140, p108, p108a, p103a, p107ap107b, p107, p109, p112, p106a, p106cp111d, p105, p110b, p110a, p111a, p111bp111c, p104, p113, p114 | Vehicle restriction |
overtaking_restriction | p125, p126 | Overtaking restriction |
physical_restriction | p116, p115, p117, p118, p120, p119, p106b | Physical restriction |
| Label | Label name | Category (value) | Subcategory |
|---|---|---|---|
p127 | Tốc độ tối đa cho phép | prohibition | — |
r420 | Bắt đầu khu đông dân cư | mandatory | — |
p127c | Biển ghép tốc độ tối đa cho phép theo phương tiện, trên từng làn đường | prohibition | — |
re10d | Hết tốc độ tối đa trong khu vực | mandatory | — |
w235 | Đường đôi | warning | — |
w204 | Đường hai chiều | warning | — |
w206 | Giao vòng xuyến | warning | — |
dgm6 | Giới hạn tốc độ tối đa theo làn trên đường cao tốc | internal_definition | — |
p130 | Cấm dừng và đỗ xe | prohibition | stopping_parking |
p136 | Cấm đi thẳng | prohibition | turning_restriction |
p139 | Cấm đi thẳng, rẽ phải | prohibition | turning_restriction |
p108a | Cấm xe sơ-mi rơ-moóc | prohibition | vehicle_restriction |
p124b | Cấm ô tô quay đầu | prohibition | turning_restriction |
p103b | Cấm ô tô rẽ phải | prohibition | turning_restriction |
p124a | Cấm quay xe | prohibition | turning_restriction |
p123b | Cấm rẽ phải | prohibition | turning_restriction |
p124d | Cấm rẽ phải và quay đầu xe | prohibition | turning_restriction |
p138 | Cấm đi thẳng, rẽ trái | prohibition | turning_restriction |
dp134 | Hết hạn chế tốc độ x tối đa | end_of_prohibition | — |
dp135 | Hết tất cả các lệnh cấm | end_of_prohibition | — |
r421 | Kết thúc khu đông dân cư | mandatory | — |
ie452 | Chỉ dẫn bắt đầu đường cao tốc | expressway_information | — |
p131a | Cấm đỗ xe | prohibition | stopping_parking |
p131c | Cấm đỗ xe ngày chẵn | prohibition | stopping_parking |
p131b | Cấm đỗ xe ngày lẻ | prohibition | stopping_parking |
p103a | Cấm ô tô | prohibition | vehicle_restriction |
p107a | Cấm xe ô tô khách | prohibition | vehicle_restriction |
p107 | Cấm xe khách và xe tải | prohibition | vehicle_restriction |
p103c | Cấm ô tô rẽ trái | prohibition | turning_restriction |
p123a | Cấm rẽ trái | prohibition | turning_restriction |
p124c | Cấm rẽ trái và quay đầu xe | prohibition | turning_restriction |
p137 | Cấm rẽ trái, rẽ phải | prohibition | turning_restriction |
p125 | Cấm vượt | prohibition | overtaking_restriction |
r306 | Tốc độ x tối thiểu cho phép | mandatory | — |
p106a | Cấm xe ô tô tải | prohibition | vehicle_restriction |
p106b | Cấm xe tải theo tải trọng | prohibition | physical_restriction |
r303 | Nơi giao nhau theo vòng xuyến | mandatory | — |
dp133 | Hết cấm vượt | end_of_prohibition | — |
p108 | Cấm xe kéo rơ-moóc | prohibition | vehicle_restriction |
r307 | Biển báo hết hạn chế tốc độ tối thiểu | mandatory | — |
p104 | Cấm xe máy | prohibition | vehicle_restriction |
dp127a | Báo đến hết đoạn đường tốc độ tối đa cho phép | end_of_prohibition | — |
dp127c | Báo đến hết đoạn đường tốc độ tối đa cho phép | end_of_prohibition | — |
dp127b | Báo đến hết đoạn đường tốc độ tối đa cho phép | end_of_prohibition | — |
r411 | Hướng đi trên mỗi làn đường theo vạch kẻ đường | mandatory | — |
w236 | Biển báo hết đường đôi | warning | — |
dgm4 | Chỉ dẫn trạm thu phí | internal_definition | — |
ie472a | Biển chỉ dẫn thu phí cao tốc | expressway_information | — |
ie472b | Biển chỉ dẫn thu phí cao tốc | expressway_information | — |
dgm16 | Làn thu phí hỗn hợp | internal_definition | — |
dgm17 | Làn thu phí ETC | internal_definition | — |
p124e | Cấm ô tô rẽ trái và quay đầu xe | prohibition | turning_restriction |
p124f | Cấm ô tô rẽ phải và quay đầu xe | prohibition | turning_restriction |
p105 | Cấm ô tô và xe máy | prohibition | vehicle_restriction |
r412 | Biển quy định làn đường, hướng di chuyển theo phương tiện | mandatory | — |
rules_payload is an array of independent lane rules — each item's vehicle_code and access_restrictions.valid_time apply only to that lane rule, not to others in the array.
Example:
"rules_payload": [
{
"change_lanes": "yes",
"lane_index": 0,
"vehicle_code": ["truck"],
"physical_limits": {
"weight": {
"max": 2.5,
"unit": "ton"
}
},
"access_restrictions": {
"valid_time": [
{
"days_of_week": ["all"],
"start_time": "06:00",
"end_time": "22:00"
}
]
}
},
{
"change_lanes": "yes",
"lane_index": 1,
"vehicle_code": ["bus_coach"],
"access_restrictions": {
"valid_time": [
{
"days_of_week": ["all"],
"start_time": "16:00",
"end_time": "20:00"
}
]
}
}
]Each rules_payload[] item may contain:
| Field | Type | Description |
|---|---|---|
lane_index | integer | Which lane this rule applies to, from 0 to 5. 0 means the rule applies to the whole road, not one specific lane (it's also the most common value — most rules aren't lane-specific). 1–5 identify individual lanes, numbered left to right. |
change_lanes | string, optional | Lane-change rule for this lane, for example "yes" or "no". Omitted when no lane-change rule is defined for that lane. See the allowed values below. |
vehicle_code | array | Vehicle classes governed by this lane rule, for example ["truck"] or ["bus_coach", "passenger_auto"]. Always a non-empty array. A rule that applies to every vehicle type is expanded into the full list of vehicle classes (see Vehicle classes) rather than a single "all" value. |
speed_limit_max | integer/null | Maximum speed for the lane, in km/h, for example 50, 60, or 70. null when no maximum speed is defined. |
speed_limit_min | integer/null | Minimum speed for the lane, in km/h. null when no minimum speed is defined — most rules only set a maximum, not a minimum. |
lane_div | string/null | Lane-divider metadata, for example dashed or solid. null when not available. |
turn_lanes | string/null | Designated turn or merge direction for this lane, for example right. null when none applies. See the values below. |
physical_limits | object, optional | Physical restrictions for the lane, most commonly a weight limit (for example {"weight": {"max": 3.5, "unit": "ton"}}) or a seat-count limit (for example {"seats": {"max": 25, "unit": "seat"}}). Omitted when no physical restriction applies to this lane rule. |
access_restrictions.valid_time | array, optional | Time ranges for this lane rule, for example [{"days_of_week": ["all"], "start_time": "06:00", "end_time": "22:00"}]. Omitted together with access_restrictions when the sign has no time restriction. |
change_lanes values:
| Value | Description |
|---|---|
yes | Allows lane changes to both the left and right when adjacent lanes exist. In the leftmost lane, it is equivalent to not_left; in the rightmost lane, it is equivalent to not_right. |
no | Prohibits leaving the current lane; changing to another lane is not allowed. |
not_right | Prohibits changing to the lane on the right but allows changing to the lane on the left. |
not_left | Prohibits changing to the lane on the left but allows changing to the lane on the right. |
turn_lanes values:
| Value | Description |
|---|---|
left | Turn left. |
through | Continue straight; equivalent to straight. |
straight | Continue straight; equivalent to through. |
right | Turn right. |
reverse | Make a U-turn. |
slide_left | Move to the lane on the left; equivalent to slight_left. |
slight_left | Move to the lane on the left; equivalent to slide_left. |
slide_right | Move to the lane on the right; equivalent to slight_right. |
slight_right | Move to the lane on the right; equivalent to slide_right. |
next_right | Prepare for an upcoming right turn. |
merge_to_left | Merge into the lane on the left. |
merge_to_right | Merge into the lane on the right. |
null | No turn-lane or merge direction is available. |
access_restrictions.valid_time item fields:
| Field | Type | Description |
|---|---|---|
days_of_week | array | Days on which the lane rule is valid, for example ["all"] or ["mon", "tue", "wed", "thu", "fri"]. |
start_time | string | Start time in HH:MM format, for example 06:00. |
end_time | string | End time in HH:MM format, for example 22:00. Can also be 24:00, meaning end of day. |
Example of one time range:
{
"days_of_week": ["all"],
"start_time": "06:00",
"end_time": "09:00"
}days_of_week values:
| Value | Day |
|---|---|
mon | Monday |
tue | Tuesday |
wed | Wednesday |
thu | Thursday |
fri | Friday |
sat | Saturday |
sun | Sunday |
all | Every day |
| Value | Definition |
|---|---|
auto | Car, automobile. |
moto | Motorbike or motorcycle. |
truck | Truck. |
bus_local | Local bus. |
bus_coach | Coach or passenger bus. |
trailer | Trailer or towing vehicle. |
sm-trailer | Semi-trailer. |
tractor | Tractor. |
bicycle | Bicycle. |
moped | Moped. |
cargo_bicycle | Cargo bicycle. |
auto_rickshaw | Auto rickshaw. |
3wm | Motorized three-wheeler. |
rickshaw | Rickshaw or cyclo. |
peds | Pedestrian. |
hand_cart | Hand cart. |
taxi | Taxi. |
passenger_auto | Passenger car. |