Autocomplete API
The autocomplete endpoint serves the purpose of retrieving suggestions in response to the keywords or query entered into the search bar.
Endpoint
GET https://app.keyspider.io/api/v1/{{Organization-Id}}/{{API-Key}}/suggest?q=fresh
Try Yourself: Autocomplete API Swagger workplace
Description: You can interact with the live API to experience and explore the capabilities of the Autocomplete API. The demo allows you to simulate API requests, view responses, and understand how the Autocomplete API functions in a real-world scenario. Feel free to input different search queries or words to see how the API responds with suggestions.
Query Parameters
q
(required): The search query string.
Request Example
curl -X 'GET'
'https://app.keyspider.io/api/v1/16575912397417890_8007/80rf53f98adf5526f2b5fffffbf55b24/suggest?q=fresh'
-H 'accept: application/json'
Response
This endpoint returns search suggestions or autocomplete results for a given search query.
Response Format
The response is in JSON format and contains the autocomplete suggestions data.
Response Structure
code
(integer): HTTP response code indicating the success of the API request.message
(string): A message describing the status of the response.suggest
(object): An object containing search suggestions.{search_query}
(object): Suggestions for the given search query.numFound
(integer): The total number of suggestions found for the search query.suggestions
(array of objects): An array of suggestion objects.payload
(string): Additional payload information.term
(string): The suggestion term or phrase.weight
(integer): Weight assigned to the suggestion (indicating relevance).
Example Response
{
"code": 200,
"message": "success",
"suggest": {
"fresh": {
"numFound": 6,
"suggestions": [
{
"term": "freshworks",
"weight": 9
},
{
"term": "freshservice",
"weight": 9
},
{
"term": "freshdesk",
"weight": 9
},
{
"term": "freshservice Cloud Discovery",
"weight": 8
},
{
"term": "freshchat",
"weight": 8
},
{
"term": "freshcaller",
"weight": 7
},
]
}
}
}
This response structure allows developers to retrieve autocomplete suggestions for a given search query and incorporate these suggestions into their applications for improved user experience.