---
schema_version: "1"
id: bd8cf2427dbe100538cd534121fa56370f67b6ed65470b34707506bb2c01e163
title: Query Objects in Marketing Cloud Next Using REST API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/mc-core/guide/mc-manage-objects/mc-manage-objects-query/mc-manage-objects-query-rest.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-rest.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f4494e1aaaad6940129389c3fe7fcbd1dbf1bab3e7e4016d282cd26d55229bd1
products:
  - Marketing Cloud Next
  - Marketing Cloud
---
# Query Objects in Marketing Cloud Next Using REST API

REST API provides a simple method for executing basic queries synchronously. If the complexity of the query or the quantity of results causes your queries to timeout, consider running them [asynchronously using Bulk API 2.0](https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-bulk.md).

## Prerequisite

Before you issue a query request, create a SOQL statement that defines the data that you want to retrieve. For more information, see [Understand SOQL Queries](https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-soql.md).

After you create a SOQL statement, remove all of the line breaks, and replace every space in the query with `%20`.

## Issue the GET Request

Issue a GET request to the `/services/data/{apiVersion}/query` endpoint, with your SOQL query included as a query string.

```
GET /services/data/{apiVersion}/query/?q=SELECT%20Id,%20FirstName,%20LastName,%20MailingCountry%20FROM%20Contact%20WHERE%20MailingCountry%20=%20%27NG%27%20ORDER%20BY%20LastName%20ASC,%20FirstName%20ASC%20LIMIT%205 HTTP/1.1
Host: YOUR_SUBDOMAIN.my.salesforce.com
Content-Type: application/json
Authorization: Bearer YOUR_BEARER_TOKEN
```

If the request is successful, the response includes a list of contacts that match your query.

```json
{
    "totalSize": 5,
    "done": true,
    "records": [
        {
            "attributes": {
                "type": "Contact",
                "url": "/services/data/{apiVersion}/sobjects/Contact/003AA000002ZZZDYAS"
            },
            "Id": "003SB000002L13DYAS",
            "FirstName": "Jon",
            "LastName": "Amos",
            "MailingCountry": "NG"
        },
        ...
    ]
}
```
