Search


GET/api/v1/{API_ID}/search, /api/v1/{API_ID}/search_or

Returns an array of all rows matching the query. If any condition is not met for a row, it will not be included in the result.

If you want a row to be included in the result when any condition is met, use the serach_or endpoint, example: https://sheetdb.io/api/v1/58f61be4dda40/search_or?name=Tom&age=22

If you want to search for a string with a space, just repace space with %20 If you want to include & symbol in your query, replace it with %26

Wildcards

You can search using wildcards. The asterisk * can represent any string. Wildcard only work when READ and SEARCH permissions are both enabled.

If you want to exclude certain rows from the search results, use an exclamation mark before the value. For example, if you want to get all rows without the one in which name = Tom, use this url:
https://sheetdb.io/api/v1/58f61be4dda40/search?name=!Tom

Relational operators

You can use relational operators to determine whether a value is greater or less than a given number. Just start with <, >, <=, >= operator. Example urls:

Multiple queries for the same column

You can use multiple queries for the same column, but you have to use array notation ([] at the end of the column name), for example:

https://sheetdb.io/api/v1/58f61be4dda40/search?id[]=>1&id[]=<3

or

https://sheetdb.io/api/v1/58f61be4dda40/search?name[]=!Tom&name[]=!Steve


Optional attributes

  • Name
    casesensitive
    Type
    boolean
    Description

    By default, the search is not case-sensitive, to change it to be case-sensitive set this attribute to true.

More examples

For more examples of how to use search in our API, check out this blog post search feature in SheetDB API or this youtube tutorial

Request

GET
/api/v1/{API_ID}
curl -G https://sheetdb.io/api/v1/58f61be4dda40/search \
  -d name=tom

JSON Response

[
    {
        "id": "1",
        "name": "Tom",
        "age": "15",
        "comment": ""
    }
]