GET
/
contacts
/
v1
/
search
/
query
Search for contacts by email, name, phone number, or company
curl --request GET \
  --url https://api.hubapi.com/contacts/v1/search/query
"\nExample GET URL:\nhttps://api.hubapi.com/contacts/v1/search/query?q=testingapis\n\nExample JSON output:\n{\n  \"query\": \"testingapis\",\n  \"offset\": 1,\n  \"has-more\": false,\n  \"total\": 1,\n  \"contacts\": [\n    {\n      \"vid\": 3234574,\n      \"canonical-vid\": 3234574,\n      \"merged-vids\": [\n        \n      ],\n      \"portal-id\": 62515,\n      \"is-contact\": true,\n      \"properties\": {\n        \"hs_analytics_last_url\": {\n          \"value\": \"\"\n        },\n        \"lead_source\": {\n          \"value\": \"DiscoverOrg\"\n        },\n        \"num_unique_conversion_events\": {\n          \"value\": \"0\"\n        },\n        \"hs_analytics_revenue\": {\n          \"value\": \"0.0\"\n        },\n        \"createdate\": {\n          \"value\": \"1484026585538\"\n        },\n        \"hs_analytics_first_referrer\": {\n          \"value\": \"\"\n        },\n        \"hs_email_optout\": {\n          \"value\": \"true\"\n        },\n        \"hs_predictivecontactscore\": {\n          \"value\": \"50\"\n        },\n        \"annualrevenue\": {\n          \"value\": \"181900000\"\n        },\n        \"hs_analytics_num_page_views\": {\n          \"value\": \"0\"\n        },\n        \"state\": {\n          \"value\": \"MA\"\n        },\n        \"zip\": {\n          \"value\": \"02139\"\n        },\n        \"fortune_rank\": {\n          \"value\": \"\"\n        },\n        \"hs_predictivecontactscorebucket\": {\n          \"value\": \"bucket_3\"\n        },\n        \"hubspotscore\": {\n          \"value\": \"0\"\n        },\n        \"linkedinconnections\": {\n          \"value\": \"0\"\n        },\n        \"hs_lifecyclestage_subscriber_date\": {\n          \"value\": \"1484026585538\"\n        },\n        \"hs_analytics_average_page_views\": {\n          \"value\": \"0\"\n        },\n        \"lastname\": {\n          \"value\": \"Test\"\n        },\n        \"twitterhandle\": {\n          \"value\": \"ghidinelli\"\n        },\n        \"phone\": {\n          \"value\": \"555-122-2323\"\n        },\n        \"num_conversion_events\": {\n          \"value\": \"0\"\n        },\n        \"currentlyinworkflow\": {\n          \"value\": \"false\"\n        },\n        \"hs_analytics_num_event_completions\": {\n          \"value\": \"2\"\n        },\n        \"followercount\": {\n          \"value\": \"582\"\n        },\n        \"hs_email_optout_2849\": {\n          \"value\": \"\"\n        },\n        \"associatedcompanyid\": {\n          \"value\": \"184896670\"\n        },\n        \"firstname\": {\n          \"value\": \"HubSpot\"\n        },\n        \"city\": {\n          \"value\": \"Cambridge\"\n        },\n        \"hs_email_optout_354586\": {\n          \"value\": \"\"\n        },\n        \"hs_social_num_broadcast_clicks\": {\n          \"value\": \"0\"\n        },\n        \"hs_analytics_last_timestamp\": {\n          \"value\": \"\"\n        },\n        \"hs_analytics_num_visits\": {\n          \"value\": \"0\"\n        },\n        \"twitterbio\": {\n          \"value\": \"Racer, entrepreneur, world traveler. Crossfitter, foodie, kitesurfing newbie. If racing is life, I'm building a lifestyle business @MotorsportReg @RaceHeroApp\"\n        },\n        \"hs_social_linkedin_clicks\": {\n          \"value\": \"0\"\n        },\n        \"hs_analytics_last_visit_timestamp\": {\n          \"value\": \"\"\n        },\n        \"hs_social_last_engagement\": {\n          \"value\": \"\"\n        },\n        \"hs_twitterid\": {\n          \"value\": \"49019793\"\n        },\n        \"associatedcompanylastupdated\": {\n          \"value\": \"13365279006997343\"\n        },\n        \"hs_analytics_source\": {\n          \"value\": \"OFFLINE\"\n        },\n        \"company\": {\n          \"value\": \"HubSpot\"\n        },\n        \"email\": {\n          \"value\": \"testingapis@hubspot.com\"\n        },\n        \"linkedinbio\": {\n          \"value\": \"Racecar driver, entrepreneur, world traveler\"\n        },\n        \"hs_analytics_first_url\": {\n          \"value\": \"\n        },\n        \"website\": {\n          \"value\": \"http://hubspot.com\"\n        },\n        \"address\": {\n          \"value\": \"25 First Street\"\n        },\n        \"hs_analytics_first_visit_timestamp\": {\n          \"value\": \"\"\n        },\n        \"hs_analytics_first_timestamp\": {\n          \"value\": \"1484026585538\"\n        },\n        \"lastmodifieddate\": {\n          \"value\": \"1484859513090\"\n        },\n        \"photo\": {\n          \"value\": \"https://d2ojpxxtu63wzl.cloudfront.net/static/5b37fd1365186dd697c8a4c950be4222_f4b374414287ef87185ce792c90c266ce333e83eac137c3105bdbd20994556a5\"\n        },\n        \"hs_social_google_plus_clicks\": {\n          \"value\": \"0\"\n        },\n        \"hs_analytics_last_referrer\": {\n          \"value\": \"\"\n        },\n        \"kloutscoregeneral\": {\n          \"value\": \"48\"\n        },\n        \"hs_email_optout_230318\": {\n          \"value\": \"\"\n        },\n        \"hs_social_facebook_clicks\": {\n          \"value\": \"0\"\n        },\n        \"twitterprofilephoto\": {\n          \"value\": \"https://pbs.twimg.com/profile_images/712369625632116736/PNku5AjB_reasonably_small.jpg\"\n        },\n        \"hs_analytics_source_data_2\": {\n          \"value\": \"\"\n        },\n        \"hs_social_twitter_clicks\": {\n          \"value\": \"0\"\n        },\n        \"hs_analytics_source_data_1\": {\n          \"value\": \"API\"\n        },\n        \"lifecyclestage\": {\n          \"value\": \"subscriber\"\n        },\n        \"hs_email_sends_since_last_engagement\": {\n          \"value\": \"0\"\n        }\n      },\n      \"form-submissions\": [\n        \n      ],\n      \"identity-profiles\": [\n        {\n          \"vid\": 3234574,\n          \"saved-at-timestamp\": 0,\n          \"deleted-changed-timestamp\": 0,\n          \"identities\": [\n            {\n              \"type\": \"EMAIL\",\n              \"value\": \"testingapis@hubspot.com\",\n              \"timestamp\": 1484026585538\n            },\n            {\n              \"type\": \"LEAD_GUID\",\n              \"value\": \"4b11f8af-50d9-4665-9c43-bb2fc46e3a80\",\n              \"timestamp\": 1484026585610\n            }\n          ]\n        }\n      ],\n      \"merge-audits\": [\n        \n      ]\n    }\n  ]\n}"

Query Parameters

q
string
required

The search term for what you're searching for. You can use all of a word or just parts of a word as well. For example, if you were searching for contacts with "hubspot" in their name or email, searching for "hub" would also return contacts with "hubspot" in their email address.

count
string

This parameter lets you specify the amount of contacts to return in your API call. The default for this parameter (if it isn't specified) is 20 contacts. The maximum amount of contacts you can have returned to you via this parameter is 100.

offset
string

This parameter is used to page through the results. Every call to this endpoint will return an offset value. This value is used in the offset= parameter of the next call to get the next page of contacts.

property
string

If you include the "property" parameter, then the properties in the "contact" object in the returned data will only include the property or properties that you request.

sort
string

This parameter takes in an internal property name (e.g. vid) and sorts contact search results by that field.

order
string

This parameter accepts DESC or ASC as values (defaults to DESC) to order results by the property specified in "sort" parameter. As such, this parameter will only work when used in conjunction with "sort".

Response

200 - application/json

Successful response - Search results for contacts matching the query

The response is of type object.