# List Records

Records can be listed and filtered via [search()](https://www.odoo.com/documentation/16.0/developer/reference/backend/orm.html#odoo.models.Model.search). It takes a mandatory [domain](https://www.odoo.com/documentation/16.0/developer/reference/backend/orm.html#reference-orm-domains) filter (possibly empty) and returns the database identifiers of all records matching the filter.

**`GET /restapi/1.0/object/{object_name}`**

**Request:**

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

**JSON Response:**

```
HTTP/1.1 200 OK

{
  'Partner': [
      7, 18, 12, 10, 17, 19, 8, 31, 26, 16, 13, 20, 30, 22, 29, 15, 23, 28, 74
  ]
}
```

**XML Response:**

```
HTTP/1.1 200 OK

<res.partner type="list">
    <item type="int">7</item>
    <item type="int">18</item>
    <item type="int">12</item>
    <item type="int">10</item>
    <item type="int">17</item>
    <item type="int">19</item>
    <item type="int">8</item>
    <item type="int">31</item>
    <item type="int">26</item>
    <item type="int">16</item>
    <item type="int">13</item>
    <item type="int">20</item>
    <item type="int">30</item>
    <item type="int">22</item>
    <item type="int">29</item>
    <item type="int">15</item>
    <item type="int">23</item>
    <item type="int">28</item>
    <item type="int">74</item>
</res.partner>
```

**Query Parameters:**

| <ul><li><strong>domain</strong> – A <a href="https://www.odoo.com/documentation/16.0/developer/reference/backend/orm.html#reference-orm-domains">search domain</a>. Use an empty list to match all records.</li><li><strong>offset</strong> – OPTIONAL. Number of results to ignore (default: none)</li><li><strong>limit</strong> – OPTIONAL. Maximum number of records to return (default: all)</li><li><strong>order</strong> – OPTIONAL. Sort string</li><li><strong>count</strong> – OPTIONAL. if True, only counts and returns the number of matching records (default: False)</li></ul> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| Headers and Status Codes | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  Request Headers         | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-accept">Accept</a> – the response content type depends on <em>Accept</em> header</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-authorization">Authorization </a>– The OAuth protocol parameters to authenticate.</li></ul>                                                                                                                                                                            |
|  Response Headers        | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type">Content-Type</a> – this depends on <em>Accept</em> header of the request</li></ul>                                                                                                                                                                                                                                                                                                                          |
| Status Codes             | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok">200 OK</a> – no error</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found">404 Not Found</a> – there’s no resource</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized">401 Unauthorized</a> – authentication failed</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-403-forbidden">403 Forbidden</a> – if any error raise</li></ul> |
