Count Records

Rather than retrieve a possibly gigantic list of records and count them, search_count() can be used to retrieve only the number of records matching the query. It takes the same domain filter as search() and no other parameter.

Warning

calling restapi/1.0/object/{object_name}/search then restapi/1.0/object/{object_name}/search_count (or the other way around) may not yield coherent results if other users are using the server: stored data could have changed between the calls

GET /restapi/1.0/object/{object_name}/search_count

Request:

GET /restapi/1.0/object/res.partner/search_count?domain=[('is_company','=',True),('customer','=',True)] HTTP/1.1
Host: {your_Odoo_server_url}

JSON Response:

HTTP/1.1 200 OK

{
  'count': 19
}

XML Response:

HTTP/1.1 200 OK

<count>19</count>

Query Parameters:

Headers and Status Codes
Description

Request Headers

Response Headers

Status Codes

Last updated