You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,40 @@ Status codes:
105
105
-`401` - missing or invalid API key
106
106
-`429` - rate limit exceeded
107
107
108
+
### GET /snap
109
+
110
+
Snaps a coordinate to the closest point on a street.
111
+
112
+
Query parameters:
113
+
-`lat` - latitude (required)
114
+
-`lon` - longitude (required)
115
+
-`key` - API key (required)
116
+
-`distance` - max search distance in meters (optional, default 75)
117
+
118
+
Example request:
119
+
120
+
```
121
+
GET /snap?lat=43.7384&lon=7.4246&key=YOUR_API_KEY
122
+
```
123
+
124
+
Response:
125
+
126
+
```json
127
+
{
128
+
"lat": 43.7383,
129
+
"lon": 7.4247,
130
+
"distance": 4.2
131
+
}
132
+
```
133
+
134
+
`distance` is meters from the input to the snapped point.
135
+
136
+
Status codes:
137
+
-`200` - success
138
+
-`401` - missing or invalid API key
139
+
-`404` - no street within `distance`
140
+
-`429` - rate limit exceeded
141
+
108
142
### Authentication
109
143
110
144
The server includes a web dashboard for managing API keys. On first launch, navigate to the server URL in a browser to create an admin account. Once logged in, you can generate API keys and create additional users with configurable rate limits.
0 commit comments