For more Algolytics products visit us at https://algolytics.com/.
Overview
API for real time autocompletion of address information. To receive access to our product or change your access password, please contact us at support@algolytics.pl.
General information
The following table shows the general HTTP status codes that may appear in any operation:
| Status code | Usage |
|---|---|
|
The request completed successfully. |
|
The target resource has been assigned a new permanent URI. Any future references to this resource ought to use one of the enclosed URIs. |
|
Redirection to a different URI. |
|
The specified method was recognized, but it is not appropriate for the requested resource. |
|
The server did not receive a complete request message from the client within the time that it was prepared to wait. |
|
The client closed the connection while the server is processing the request. |
|
The server encountered an unexpected condition that prevented it from fulfilling the request. |
|
The server seems to be unable to handle the requests. |
|
The server could not provide response in time. |
User operations
Autocomplete: city
Method |
POST |
Path |
api/autocomplete/city |
Request is used to autocomplete city name.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request was malformed. The response body will include an error providing further information. |
|
The request entity has a media type which the server does not support. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Input value for city hints. |
|
|
[Optional] - Ignored when requesting for city hints. |
|
|
[Optional] - Ignored when requesting for city hints. |
Response structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
City hints for the given request. |
|
|
Present city name. |
|
|
The name of the city searched by the user, which is not the present name of the city. If null, the present city name has been matched to the user’s query. |
|
|
Information if the city has streets. |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/city' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"city" : "Pelplin-Nadl",
"street" : null,
"buildingNumber" : null
}'
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 132
{
"hints" : [ {
"lookedUpName" : "Pelplin-Nadleśnictwo",
"actualName" : "Nadleśnictwo",
"hasStreets" : false
} ]
}
Autocomplete: street
Method |
POST |
Path |
api/autocomplete/street |
Request is used to autocomplete name of the street within the given city.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request was malformed. The response body will include an error providing further information. |
|
The request entity has a media type which the server does not support. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Full present name of the city in which to look for the street. |
|
|
Input value for street hints. |
|
|
[Optional] - Ignored when requesting for street hints. |
Response structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Street hints for the given request. |
|
|
Present street name. |
|
|
The name of the street searched by the user, which is not the present name of the street. If null, the present street name has been matched to the user’s query. |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/street' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"city" : "Brzeziny",
"street" : "Armii Czer",
"buildingNumber" : null
}'
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 104
{
"hints" : [ {
"lookedUpName" : "Armii Czerwonej",
"actualName" : "Szarych Szeregów"
} ]
}
Autocomplete: building
Method |
POST |
Path |
api/autocomplete/building |
Request is used to autocomplete building number within the given city and street.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request was malformed. The response body will include an error providing further information. |
|
The request entity has a media type which the server does not support. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Full present name of the city in which to look for the building. |
|
|
[Optional] - Full present name of the street on which to look for the building. May be null to indicate that there is no street in the given address. |
|
|
Input value for building hints. |
Response structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Building hints for the given request. |
|
|
Building number. |
|
|
Postal code for the building. |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/building' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"city" : "Suchy Las",
"street" : "Sucholeska",
"buildingNumber" : "1"
}'
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 337
{
"hints" : [ {
"postalCode" : "62-002",
"buildingNumber" : "1"
}, {
"postalCode" : "62-002",
"buildingNumber" : "10"
}, {
"postalCode" : "62-002",
"buildingNumber" : "12"
}, {
"postalCode" : "62-002",
"buildingNumber" : "14"
}, {
"postalCode" : "62-002",
"buildingNumber" : "16"
} ]
}
Autocomplete: postal code
Method |
POST |
Path |
api/autocomplete/postalcode |
Request is used to get postal code for given address.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request was malformed. The response body will include an error providing further information. |
|
The request entity has a media type which the server does not support. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Full present name of the city in which to look for the postal code. |
|
|
[Optional] - Full present name of the street on which to look for the postal code. This value will be ignored when city doesn’t contain given street. May be null to indicate that there is no street in the given address. If building number is also null postal codes for the city will be returned. |
|
|
[Optional] - Building number. This value will be ignored when street doesn’t contain given building number. If null algorithm will search for all postal codes for given city and street. |
Response structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Building hints for the given request. |
|
|
Postal code for the given address. Multiple codes can be returned if they were matched to the city or street level. |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/postalcode' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"city" : "Warszawa",
"street" : "Puławska",
"buildingNumber" : "228"
}'
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 53
{
"hints" : [ {
"postalCode" : "02-566"
} ]
}
Autocomplete: check postal code
Method |
GET |
Path |
api/autocomplete/check/{postalcode} |
Request is used to check if given postal code exists. Postal code should be provided in format dd-ddd where d is digit from range 0-9. In case the postal code does exist, the HTTP status code 200 is returned (with empty response). Otherwise status code 404 is returned, along with the message "Postal code doesn’t exist".
HTTP status codes
| Status code | Usage |
|---|---|
|
The request was malformed. The response body will include an error providing further information. |
|
The requested resource could not be found |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Parameter | Description |
|---|---|
|
Postal code to be checked if it exist. |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/check/02-822' -i -X GET
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Administrative operations
Autocomplete: indexing status
Method |
GET |
Path |
api/autocomplete/status |
Request is used to check in what state the application is located. It also provides information on when was the last successful indexing and if reindexing is ongoing.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request has not been applied because it lacks valid authentication credentials for the target resource. |
|
User has insufficient permissions to call this method. |
Request structure
| Name | Description |
|---|---|
|
Basic auth credentials |
Response structure
| Name | Description |
|---|---|
|
application/json;charset=UTF-8 |
| Path | Type | Description |
|---|---|---|
|
|
Exact time of last successful indexing. |
|
|
Application status. Application may be in one of following states: - OK: Application is serving incoming requests. |
|
|
Information if data is being re indexed at the moment. Reindexing can be performed only in following states: - STOPPED |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/status' -i -u 'admin:p4ssword' -X GET \
-H 'Accept: application/json'
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 107
{
"lastSuccessfulIndexing" : "2024-06-21T09:50:05.601+00:00",
"status" : "OK",
"reindexing" : false
}
Autocomplete: stop
Method |
GET |
Path |
api/autocomplete/stop |
Request is used to stop application. Stopped application doesn’t serve any requests. After successfully stopping application reindexing may be performed.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request has not been applied because it lacks valid authentication credentials for the target resource. |
|
User has insufficient permissions to call this method. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
Basic auth credentials |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/stop' -i -u 'admin:p4ssword' -X GET
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Autocomplete: abort
Method |
GET |
Path |
api/autocomplete/abort |
Request is used to abort maintenance. Maintenance can be aborted only when application is stopped and you do not wish to perform reindexing.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request has not been applied because it lacks valid authentication credentials for the target resource. |
|
User has insufficient permissions to call this method. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
Basic auth credentials |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/abort' -i -u 'admin:p4ssword' -X GET
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Autocomplete: reindex data
Method |
GET |
Path |
api/autocomplete/reindex |
Request is used initiate async indexing process. Process will reload dictionary data into memory. During that time other services will not be available.
HTTP status codes
| Status code | Usage |
|---|---|
|
The request has not been applied because it lacks valid authentication credentials for the target resource. |
|
User has insufficient permissions to call this method. |
|
The request was well-formed but server is currently unavailable. Service will be in this state during re indexing process. |
Request structure
| Name | Description |
|---|---|
|
Basic auth credentials |
Example
$ curl 'https://autocomplete.example.host/api/autocomplete/reindex' -i -u 'admin:p4ssword' -X GET
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY