jsonplaceholder icon indicating copy to clipboard operation
jsonplaceholder copied to clipboard

Perform a query for autocomplete

Open DeborahK opened this issue 3 years ago • 1 comments

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!

DeborahK avatar Mar 23 '21 21:03 DeborahK

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

mohaned2014 avatar Jan 04 '22 18:01 mohaned2014