jsonplaceholder
jsonplaceholder copied to clipboard
Perform a query for autocomplete
Consider adding an option to perform a query to allow for an autocomplete. It would match the start of a field. Something like:
https://jsonplaceholder.typicode.com/posts?_query=qui
Would return all of the posts that start with the defined characters.
Something like provided here: https://swapi.dev/documentation under "search"
OR
Something like this:
https://jsonplaceholder.typicode.com/posts?title=^q // regex syntax
Thanks!
you can use
https://jsonplaceholder.typicode.com/posts?title_like=^q // regex syntax
In general, the API supports everything implemented by JSON Server. You can check that project's README/docs for paging/sort/filter/search related parameters: https://github.com/typicode/json-server