Rapattoni Developer Resources

RESO Web API

Rapattoni offers an implementation of RESO's Web API, and provides data adhering to the RESO Data Dictionary.

You will need to contact the particular MLS you wish to obtain data from, prior to access being granted.

Authentication

We support OAuth2's Password and Authorization Code grant types for authentication.

Password Grant Authentication

Token URL:

  • https://retsidentityapi.raprets.com/{mls}/oauth/token

When accessing the Token URL, you will need to pass the following in the body of a POST request:

  • grant_type: password
  • client_id: Given to you by the MLS
  • client_secret: A password associated with the client id, it is a randomly generated hash. If this is ever compromised a new one may be generated by MLS staff.
  • Username: The MLS ID created in membership.
  • Password: The password associated with the above MLS ID.

Please note, standard web browsers cannot pass all of the criteria; a client program or tool should be used. Example clients for testing are Postman and cURL

The body of the request should look similar to the following example:

  • grant_type=password&client_id=ClientID&client_secret=Secret&username=Username&password=Password

You will also need to include the header:Content-Type: application/x-www-form-urlencoded and ensure that the values contained in the body of the request are properly URL-encoded.

cURL example:

  • curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "Grant_Type=password&Client_Id=URLEncoded_ClientID&Client_Secret=URLEncoded_ClientSecret&Username=URLEncoded_Username&Password=URLEncoded_Password" "https://retsidentityapi.raprets.com/{mls}/oauth/token"

If the transaction is successful, then the response body will be a JSON object containing the access token, token type, seconds till expiration, refresh token, username, date time issued and date time of expiration. The token type will always be “bearer”:
{
"access_token": "9ad80cb9875c6d8e39efc90bc",
"token_type": "bearer",
"expires_in": 604799,
"refresh_token": "adb83739efc90bcd9938",
"userName": "username",
".issued": "Fri, 17 Mar 2017 16:41:32 GMT"
".expires": "Fri, 24 Mar 2017 16:41:32 GMT"
}

Client Credentials Grant Authentication

Token URL:

  • https://retsidentityapi.raprets.com/{mls}/oauth/token

When accessing the Token URL, you will need to pass the following in the body of a POST request:

  • grant_type: client_credentials
  • client_id: Given to you by the MLS
  • client_secret: A password associated with the client id, it is a randomly generated hash. If this is ever compromised a new one may be generated by MLS staff.

Please note, standard web browsers cannot pass all of the criteria; a client program or tool should be used. Example clients for testing are Postman and cURL

The body of the request should look similar to the following example:

  • grant_type=client_credentials&client_id=ClientID&client_secret=Secret

You will also need to include the header:Content-Type: application/x-www-form-urlencoded and ensure that the values contained in the body of the request are properly URL-encoded.

cURL example:

  • curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "Grant_Type=client_credentials&Client_Id=URLEncoded_ClientID&Client_Secret=URLEncoded_ClientSecret" "https://retsidentityapi.raprets.com/{mls}/oauth/token"

If the transaction is successful, then the response body will be a JSON object containing the access token, token type, seconds till expiration, refresh token, username, date time issued and date time of expiration. The token type will always be “bearer”:
{
"access_token": "9ad80cb9875c6d8e39efc90bc",
"token_type": "bearer",
"expires_in": 604799,
"refresh_token": "adb83739efc90bcd9938",
"userName": "username",
".issued": "Fri, 17 Mar 2017 16:41:32 GMT"
".expires": "Fri, 24 Mar 2017 16:41:32 GMT"
}

Authorization Code Grant Authentication

Authorization URL:

  • https://retsidentityapi.raprets.com/{mls}/oauth/authorize

You will need to pass the following information as query string parameters in a GET request with the Authorization URL.

  • response_type=code Code is the only value we accept for the response type when using Authorization Code authentication.
  • client_id=clientid The value should be the Client ID assigned to you by the MLS.
  • redirect_uri=uri Your URL that will be redirected to, with the authorization code, in order to complete the authentication process
  • state=string_value (Optional) If included, then it is expected to be passed back to your redirect uri with the authorization code.
  • Example: https://retsidentityapi.raprets.com/{mls}/oauth/authorize?response_type=code&client_id=ClientID&redirect_uri=https://your_redirect_uri

Once the request has been sent, our server will respond with a login page to enter a valid MLS Username and Password. This could be information granted to you by the MLS, or it could be the login information of an agent utilizing your product.

If valid MLS credentials have been entered, then you, or the end user, will be prompted to grant your application access to the MLS API information on your/their behalf.

If successful we will pass the Authorization code and state (if included) in the query parameters of a GET request to your Redirect URI.

  • Example: https://your_redirect_uri?code=authorization_code&state=the_state_string_if_used

You can then pass the following to the token end point to recieve a bearer token for API access:

Token URL:

  • https://retsidentityapi.raprets.com/{mls}/oauth/token

When accessing the Token URL, you will need to pass the following in the body of a POST request:

  • grant_type:authorization_code
  • client_id:Given to you by the MLS, the same as you used in the initial authorization request.
  • client_secret:A password associated with the client id given to you by the MLS. It is a randomly generated hash. If this is ever compromised a new one may be generated by MLS staff.
  • code: The Authorization Code you recieved.
  • redirect_uri: The redirect_uri that you used in the initial authorization request. This must be given to the MLS staff as well and will be linked to your credentials.

Please note, standard web browsers cannot pass all of the criteria; a client program or tool should be used. Example clients for testing are Postman and cURL

The body of the request should look similar to the following example:

  • grant_type=authorization_code&client_id=ClientID&client_secret=Secret&code=abc8393d9b8c7e8f03&redirect_uri=https://your_redirect

You will also need to include the header:Content-Type: application/x-www-form-urlencoded and ensure that the values contained in the body of the request are properly URL-encoded.

If the transaction is successful, then the response body will be a JSON object containing the access token, token type, seconds till expiration, refresh token, username, date time issued, date time of expiration and your client_id. The token type will always be “bearer”:
{
"access_token": "9ad80cb9875c6d8e39efc90bc",
"token_type": "bearer",
"expires_in": 5183999,
"refresh_token": "adb83739efc90bcd9938",
".issued": "Tue, 10 Sep 2019 23:18:25 GMT",
".expires": "Sat, 09 Nov 2019 23:18:25 GMT",
"client_id": "ClientID"
}


API Transactions

All transactions must include the Authorization header with the value being the client’s current bearer token obtained from the transaction with our Authentication server.

Here is an example of the how the Authorization header with the bearer token should appear in the HTTP request:

  • Authorization:bearer 80957f49b90d449c99dfb01871676e3e

Responses, unless otherwise specified, will be in the JSON format.

Service and Metadata

The Service Document is available via a get request against the root URL (http://retsapi.raprets.com/2/{mls}/RESO/odata). This document is a standard OData resource listing all top-level entity sets exposed by the service.( ODatav4 10.1)

Querying this endpoint will return a JSON array of all directly queryable entities. Each object will have the following properties:

  • Name matches the name of the entity in the metadata.
  • Kind is the type of object being described.
  • Url is the end point to use in the URL for access.

    {
        "name": "Property",
        "kind": "EntitySet",
        "url": "Property"
    },
    {
        "name": "Agents",
        "kind": "EntitySet",
        "url": "Agents"
    },
                    

The Metadata Document is available via a get request against the root URL with /$metadata appended (i.e. http://retsapi.raprets.com/2/{mls}/RESO/odata/$metadata). This resource describes the API’s data model; including data types, relationships between entity sets, and available fields (ODatav4 11.1.2). This resource is only available in the XML format.

Metadata Entities

Each entity definition will begin with the <EntityType> tag containing the Name of the entity.

      
    <EntityType Name="Property">
                

Metadata Keys

The first child element listed under the EntityType tag will be the Key definition, this tag will contain child elements defining the key field(s) for the entity. Keys can be used to target a specific record in an entity.

    <Key>
        <PropertyRef Name="ListingKey" />
    </Key>
                    

Metadata Fields

The next elements will describe the properties of the entity, these define the available fields and should include the field’s datatype, maximum character length (if applicable), and, if the field is not an RESO defined Data Dictionary field, an annotation with the plain text MLS specific description. If the field is enumerated, then it will also contain an annotation with the LookupName to use in conjunction with the Lookup entity set

    <Property Name="ArchitecturalStyle" Type="Collection(Edm.String)" MaxLength="100">
        <Annotation Term="RESO.OData.Metadata.LookupName" String="ArchitecturalStyle" />
        <Annotation Term="RESO.OData.Metadata.DisplayName" String="Style" />
    </Property>
    <Property Name="Association" Type="Edm.String" MaxLength="50" >
        <Annotation Term="RESO.OData.Metadata.LookupName" String="Association" />
        <Annotation Term="RESO.OData.Metadata.DisplayName" String="Association" />
    </Property>
    <Property Name="AssociationFee" Type="Edm.Decimal" Precision="7" Scale="2">
        <Annotation Term="RESO.OData.Metadata.DisplayName" String="Annual HOA Fee" />
    </Property>
        <Property Name="AssociationYN" Type="Edm.Boolean">
        <Annotation Term="RESO.OData.Metadata.DisplayName" String="HOA" />
    </Property>

Metadata Navigation Properties

The final elements will be the navigation properties. These define entities that can be expanded to. They contain the Name of the navigation property, the Type of the entity and possible Referential Constraints.

    <NavigationProperty Name="ListAgent" Type="Rapattoni.Rets.Api.Models.Member" />
    <NavigationProperty Name="ListOffice" Type="Rapattoni.Rets.Api.Models.Office" />
    <NavigationProperty Name="BuyerAgent" Type="Rapattoni.Rets.Api.Models.Member" />
    <NavigationProperty Name="BuyerOffice" Type="Rapattoni.Rets.Api.Models.Office" />
    <NavigationProperty Name="Media" Type="Collection(Rapattoni.Rets.Api.Models.Media)" />
    <NavigationProperty Name="HistoryTransactional" Type="Collection(Rapattoni.Rets.Api.Models.History)" />
    <NavigationProperty Name="OpenHouse" Type="Collection(Rapattoni.Rets.Api.Models.OpenHouse)" />
  • Name is the value used in the $expand clause. i.e. $expand=ListAgent
  • Type is full name of the entity targeted by the navigation property. While ListAgent is the name of a navigation property above, it’s actually targeting the entity Member. This means you would look in the metadata for the Entity Type named Member for more information regarding the entity that navigation property is targeting. If the Type starts with the word Collection, then the mapping between the entity and the navigation property entity is one-to-many (i.e. one record may map to many records, e.g. one Property may map to many Media).
  • ReferentialConstraint references the field(s) being used to link records in the two resources; also known as the Foreign Key. Usually this reference only appears if the field is not one of the entity’s keys.

Navigation property information is also listed for each Entity Set in the Default Schema section at the end of the $metadata:



    <EntitySet Name="OpenHouse" EntityType="Rapattoni.Rets.Api.Models.OpenHouse">
        <NavigationPropertyBinding Path="Property" Target="Property" />
    </EntitySet>
    <EntitySet Name="Property" EntityType="Rapattoni.Rets.Api.Models.Property">
        <NavigationPropertyBinding Path="ListAgent" Target="Member" />
        <NavigationPropertyBinding Path="ListOffice" Target="Office" />
        <NavigationPropertyBinding Path="BuyerAgent" Target="Member" />
        <NavigationPropertyBinding Path="BuyerOffice" Target="Office" />
        <NavigationPropertyBinding Path="Media" Target="Media" />
        <NavigationPropertyBinding Path="HistoryTransactional" Target="History" />
        <NavigationPropertyBinding Path="OpenHouse" Target="OpenHouse" />
    </EntitySet>
  • Path is the value used in the $expand clause. i.e. $expand=ListAgent
  • Type is full name of the entity targeted by the navigation property. While ListAgent is the name of a navigation property above, it’s actually targeting the entity Member. This means you would look in the metadata for the Entity Type named Member for more information regarding the entity that navigation property is targeting. If the Type starts with the word Collection, then the mapping between the entity and the navigation property entity is one-to-many (i.e. one record may map to many records, e.g. one Property may map to many Media).

Lookup

The Lookup endpoint will list all avaiable pre-defined enumeration values any given field can have as part of its definition.

  • LookupKey: The key used to uniquely identify the Lookup entry.
  • LookupName: The name of the enumeration. This may be the LookupField from the adopted Data Dictionary, or a local name. This will correspond to the LookupName Annotation in the $metadata.
  • LookupValue: The human-friendly display name the data consumer receives in the payload and uses in queries.
  • StandardLookupValue: The Data Dictionary LookupDisplayName of the enumerated value.
  • ModificationTimestamp: The timestamp for when the enumeration value was last modified.

    {
    "@odata.context": "http://retsapi.raprets.com/2/{mls}/RESO/OData/$metadata#Lookup",
        "value": [
            {
                "LookupKey": "13500",
                "LookupName": "MlsStatus",
                "LookupValue": "Coming Soon",
                "StandardLookupValue": "",
                "ModificationTimestamp": "2024-05-30T20:42:02.96-07:00"
            },
            {
                "LookupKey": "15529",
                "LookupName": "MlsStatus",
                "LookupValue": "Active - Under Lease",
                "StandardLookupValue": "",
                "ModificationTimestamp": "2024-05-30T20:42:02.96-07:00"
            },
            {
                "LookupKey": "15530",
                "LookupName": "MlsStatus",
                "LookupValue": "Application Pending",
                "StandardLookupValue": "",
                "ModificationTimestamp": "2024-05-30T20:42:02.96-07:00"
            }
        ]
    }

DataSystem

The DataSystem endpoint will list all available Resources and Class values. The Localization arrary will contain the available Classes. The Class parameter is opitional except for Media: Media will by default return Proprty Pictures unless the Class parameter is included and specifies a different Media category.
Example DataSystem:


Query: http://retsapi.raprets.com/2/{mls}/RESO/odata/DataSystem

Results:
{
    "@odata.context": "http://retsapi.raprets.com/2/{mls}/RESO/OData/$metadata#DataSystem/$entity",
    "Id": 1,
    "Mls": "mls",
    "Name": "Rapattoni Rets",
    "ServiceUri": "http://retsapi.raprets.com/2/{mls}/RESO/OData",
    "DateTimeStamp": "2017-03-16T10:18:19.26-07:00",
    "TransportVersion": "1.0.2",
    "DataDictionaryVersion": "1.6",
    "Resources": [
        {
            "Id": 1,
            "DataSystemId": 1,
            "Name": "Property",
            "ResourcePath": "/Property",
            "Description": "The property endpoint",
            "DateTimeStamp": "2016-07-11T14:20:13.863-07:00",
            "TimeZoneOffset": 0,
            "Localization": [
                {
                    "Name": "Land",
                    "ResourcePath": "/Property?class=Land",
                    "Description": "Contains data for Land searches.",
                    "DateTimeStamp": "2017-11-07T18:16:43.1-08:00"
                },
                {
                    "Name": "Residential",
                    "ResourcePath": "/Property?class=Residential",
                    "Description": "Contains data for Residential searches.",
                    "DateTimeStamp": "2017-11-07T18:16:43.1-08:00"
                }
            ]
        },
        {
            "Id": 2,
            "DataSystemId": 1,
            "Name": "Agent",
            "ResourcePath": "/Agents",
            "Description": "The agent endpoint",
            "DateTimeStamp": "2016-07-11T14:20:13.863-07:00",
            "TimeZoneOffset": 0,
            "Localization": [
                {
                    "Name": "Member",
                    "ResourcePath": "/Agents?class=Member",
                    "Description": "Contains data for Agent searches.",
                    "DateTimeStamp": "2017-07-18T23:12:38.953-07:00"
                }
            ]
        }
    ]
}

 

Query Support

Entity Set Queries:Entity Set queries use the default OData format; the root URL is appended with “/EntitySet”. The ResourcePath elements returned from the DataSystem query are the exact entity set values to use. The following URL would be used for querying the Property entity set:

  • http://retsapi.raprets.com/2/{mls}/RESO/OData/Property

Queries against any entity set MAY include the Class query argument; the Classes available for each entity set are displayed in the DataSystem endpoint in the Localization array (see above DataSystem example). Class is case insentsitive. Media will by default only return property pictures unless the Class parameter is included to target a different Media category. The following are the class values to use for querying Attached Documents, Virtual Tours, Member Photos, and Office Banners:

  • http://retsapi.raprets.com/2/{mls}/RESO/OData/Media?class=AttachedDocuments
  • http://retsapi.raprets.com/2/{mls}/RESO/OData/Media?class=VirtualMedia
  • http://retsapi.raprets.com/2/{mls}/RESO/OData/Media?class=Member
  • http://retsapi.raprets.com/2/{mls}/RESO/OData/Media?class=Office

When Querying against Entity Sets, our implementation of the RESO Web API supports most OData 4 query options, functions and operators. The below list are those query options and some of their associated supported functions and operators. Please see the OData 4 specification for further information in regards to these:

    • &: Multiple query options can be included at once, each separated by an “&”
      • Example: Property?$filter=MlsStatus eq 'Active'&$select=ListingKey,City&$top=10
    • Single Entity: To return one specific Entity, the format is EntitySet(key). For example, if pulling back listing key 101 from the Property entity set, the root URL would be appended with /Property('101'). Please refer to the metadata to find the primary key for each Entity Set.
      • Example: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property('101')
    • $select : This is used to specify what fields you would like to have return in the results.(ODatav4 11.2.4.2)
      • Example URL: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$select=ListingKey,ListingId,StandardStatus,City
    • $filter : restrict the returned entities to only those matching the filter criteria (ODatav4 11.2.5.1)
      • Operators
        • eq : Equals
          • Example : StandardStatus equals Active: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=StandardStatus eq 'Active'
        • ne : Not Equals
          • Example : City not equals Granite Bay: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=City ne 'Granite Bay'
        • gt : Greater than
          • Example: BathroomsTotalInteger greater than 2: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger gt '2'
        • lt : Less than
          • Example: BathroomsTotalInteger less than 2: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger lt '2'
        • and: Logical and
          • Example: BathroomsTotalInteger less than 2 and City equals San Francisco: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger lt '2' and City eq 'San Francisco'
        • or: Logical or
          • Example: BathroomsTotalInteger less than 2 or City equals San Francisco: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger lt '2' or City eq 'San Francisco'
        • not: Logical negation, used in conjunction with other functions and operators to create a negative comparison.
          • Example: BathroomsTotalInteger less than 2 and not City equals San Francisco: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger lt '2' and not City eq 'San Francisco'
        • in: Is a member of. Uses a comma seperated list of values that are being searched for.
          • Example: ListingId where it exists in this list: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=ListingId in ('12345A','23456B','C09876','D67890','E01928')
        • (): Functions and operators can be nested using parentheses for precedence.
          • Example: BathroomsTotalInteger less than 2 or (City equals San Francisco and MlsStatus equals Sold): http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=BathroomsTotalInteger lt '2' or (City eq 'San Francisco' and MlsStatus eq 'Sold')
        • has: The has operator returns true if the right hand operand is an enumeration value whose flag(s) are set on the left operand. The null value is treated as unknown, so if one operand evaluates to null, the has operator returns null. Please refer to the metadata for supported Enumeration values.
          • Example: The value, or one of the values,in ListingTerms is 'Cash': http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=ListingTerms has Rapattoni.Rets.Api.Models.ListingTerms'Cash'
      • Functions
        • contains: string contains, syntax is: contains(FieldName,’string’)
        • endswith: string ends with, syntax is: endswith(FieldName,’string’)
        • startswith: string starts with, syntax is: startswith(FieldName,’string’)
        • day: return the day component from a DateTimeOffset or Date
        • hour: return the hour component from a DateTimeOffset
        • minute: return the minute component from a DateTimeOffset
        • second: return the second component from a DateTimeOffset
        • month: return the month component from a DateTimeOffset or Date
        • year: return the year component from a DateTimeOffset or Date
      • Geography
        • geo.distance:The geo.distance function returns the shortest distance between the two points in the coordinate reference system signified by the two points' SRIDs. This is most often used with lt or le (less than or less than or equal to) for a radius search:
          • Example: Searching for a listing less than 1000 meters from a given point(Location is our Geography Point assigned to listings): http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=geo.distance(Location, geography'POINT(-79.209274 37.388645)') lt 1000
      • Lambda Operators
        • any:returns true if and only if the expression is true for any member of the collection.
          • Example: Searching for listings that have Stair Lift as a value in AccessibilityFeatures: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=AccessibilityFeatures/any(a:a eq 'Stair Lift')
          • Example: Searching for listings that have an OpenHouse record with OpenHouseDate equaling a specific date: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=OpenHouse/any(x:x/OpenHouseDate eq 2025-06-01)
        • all:returns true if the expression is true for all members of the collection
          • Example: Searching for listings that have Public Sewer as the only value in Sewer: http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$filter=Sewer/all(a:a eq 'Public Sewer')
      • Complex Filter Example:
        • Property?$filter=(contains(PublicRemarks,‘pool’) and City eq ‘Ventura’) or ListingTerms has Rapattoni.Rets.Api.Models.ListingTerms'Cash'
    • $top : Limit the number of results returned.(ODatav4 11.2.5.3)
      • Example: Returning the first 10 records http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$top=10
    • $skip : skip a number of records before returning results(ODatav4 11.2.5.4)
      • Example: Skip the first 100 records, then return results. http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$skip=100
    • $orderby: order the results by a specific field’s value; use asc or desc to specify ascending or descending. To order by multiple criteria use comma delimiting(ODatav4 11.2.5.2)
      Examples:
      • http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$orderby=City desc
      • http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$orderby=Status asc
    • $count: $count=true specifies that the total count of entities matching the request must be returned along with the results (ODatav4 11.2.5.5)
      Example:
      • http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$count=true
    • $apply: $apply triggers data aggrigation behavior, at this time only the groupby extension is supported. (ODatav4 Extension for Data Aggregation Section 3)
      • groupby: groupby takes one or two fields, and returns a distinct list of those fields's values.(ODatav4 Extension for Data Aggregation Section 3.10)
      • Example, the following would return a distinct set of all City values assigned to Property records:
        • http://retsapi.raprets.com/2/{mls}/RESO/OData/Property?$apply=groupby((City))
    • $expand: allows for the inclusion of entities related to the base entity set queried. The relationships between entity sets can be found in the metadata document. Multiple entities can be included with comma delimiting.(ODatav4 11.2.4.2)
      Examples:
      • Property?$expand=Media: this will return Property records and their related entries from Media.
    • Paging: Server paging is enabled; the server will limit the number of records that it sends in a single response.
      • @odata.nextLink: If the number of records matching the query parameters is greater than the page size limit, then the results will include the “@odata.nextLink” JSON object. This object will usually exist at the end of the current result and will contain the exact URL and query parameters needed to obtain the next page of matching records.
      • odata.maxpagesize: You may specify a custom page size by including the Prefer header with the odata.maxpagesize preference. If the page size specified is greater than the server's page size limits, then the server page size will be used instead.
        • Example: Prefer:odata.maxpagesize=50
      • Server Page Size: The server page size limits are based on the number of fields selected and time of day (based on the MLS's timezone). If $expand is included in the query, then the limits are 1/4 of their normal value.
Columns SelectedResource(Entity)Time of DayPage Size
1-4 Any Except Media Any 1000000
1-4 Media Any 100000
5-50 Any Any 2000
51+ Any 8am-6pm 1000
51+ Any 6:01pm-7:59am 2000