Skip to content

Search

PhantomJSON supports full-text search across multiple fields using the q query parameter.

Terminal window
?q=searchterm
Terminal window
curl "https://api.phantomjson.app/v1/users?q=john"
  • Case-insensitive substring match
  • Searches across multiple fields per resource
  • Matches partial words
Resource Searchable Fields
Users firstName, lastName, email
Posts title, body
Comments name, body
Todos title
Albums title
Photos title
Products name, description
Terminal window
# Search by name
curl "https://api.phantomjson.app/v1/users?q=john"
# Search by email
curl "https://api.phantomjson.app/v1/users?q=example"
Terminal window
curl "https://api.phantomjson.app/v1/posts?q=react"
Terminal window
curl "https://api.phantomjson.app/v1/products?q=iphone"

Search works with pagination, filtering, and sorting:

Terminal window
# Search + pagination
curl "https://api.phantomjson.app/v1/users?q=john&page=1&limit=10"
# Search + filter
curl "https://api.phantomjson.app/v1/products?q=phone&category=smartphones"
# Search + sort
curl "https://api.phantomjson.app/v1/users?q=john&sort=firstName:asc"