# How does the Search Contact endpoint work?

**URL:** <https://community.hubspot.com/t/how-does-the-search-contact-endpoint-work/34290>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [March 22, 2021, 7:46pm UTC](https://community.hubspot.com/t/how-does-the-search-contact-endpoint-work/34290 "2021-03-22T19:46:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikodev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nikodev/32/44733_2.png) [@nikodev](https://community.hubspot.com/u/nikodev)\
**Post date:** [March 22, 2021, 7:46pm UTC](https://community.hubspot.com/t/how-does-the-search-contact-endpoint-work/34290/1 "2021-03-22T19:46:16Z")

</div>

Hey there,  
Having an issue making a seemingly simple request.

```lia-code-sample
var request = require("request");

var options = {
 method: 'POST',
 url: 'https://api.hubapi.com/crm/v3/objects/contacts/search',
 qs: {hapikey: API_KEY},
 headers: {accept: 'application/json', 'content-type': 'application/json'},
 body: {
 filterGroups: [{filters: [{value: '123', propertyName: 'pp_id_parrain', operator: 'EQ'}]}],
 sorts: ['string'],
 query: '123',
 properties: ['firstname'],
 limit: 50,
 after: 50
 },
 json: true
};

request(options, function (error, response, body) {
 if (error) throw new Error(error);

 console.log(body);
});

```

This is returning:

```lia-code-sample
HTTP 200

{
 "total": 1,
 "results": []
}

```

I don’t understand why the results aren’t returning a first name. Or results of any kind. I was under the impression the [‘firstname’] in the properties param would mean the firstname of the contact object matching the query would be returned.  
Anyone willing to offer some insight?

---

<div class="post-metadata">

**Author:** ![RMones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rmones/32/82797_2.png) [@RMones](https://community.hubspot.com/u/RMones)\
**Post date:** [March 22, 2021, 8:06pm UTC](https://community.hubspot.com/t/how-does-the-search-contact-endpoint-work/34290/2 "2021-03-22T20:06:50Z")

</div>

Hi @nikodev ,

I think you get this response because u are using the after parameter with 50. Change this to 0 and your pagination wil start with the first page.

> **[Search the CRM - HubSpot docs](https://developers.hubspot.com/docs/api-reference/latest/crm/search-the-crm)**
>
> The CRM search endpoints make getting data more efficient by allowing developers to filter, sort, and search across any CRM object type.

To access the next page of results, you must pass the after parameter provided in the paging.next.after property of the previous response. If the paging.next.after property isn’t provided, there are no additional results to display. Note: The after parameter is expected to be a string.

Another thing you can try is remove the query options; [https://community.hubspot.com/t5/APIs-Integrations/Search-Contact-using-Nodejs-Library-Call/m-p/394400](https://community.hubspot.com/t5/APIs-Integrations/Search-Contact-using-Nodejs-Library-Call/m-p/394400)

Regards Ronald
