API LIBRARY
Collapse Sidebar Menu
Expand Drawer

Replication Endpoint

When replicating millions of records, it is recommended to use the 'Replication' endpoint. This feature allows for fast and efficient querying of records. You may use any filter as a start and then use the 'NextLink' to scroll through the entire result set.

It is recommended to use a single thread for replication. If multiple threads are desired, you may split the query by zip code or ModificationTimestamp by the month etc. and run each replication on a separate thread.

For WebApi: 
Add new 'replication' query parameter to your regular query:
"&replication=true"

In the result, you will get a "@odata.nextLink" node. Use that for getting the next set of results for each subsequent call.

RETS:
Add new 'Replication' query parameter to your regular query:
"&Replication=true"

In the result, you will get a "NEXTLINK" node. Use that for getting the next set of results for each subsequent call.


Psuedo Code:

Build initial Query with filters and other settings. Append '&Replication=true' to the query.
From the response, 'nextLink' = value of "@odata.nextLink" [OData] or "NEXTLINK" [RETS]
while(recordCount != 0)
{
    Query Trestle with 'nextLink'    
    Process results
}
Done.



Examples

Code Example

https://api-prod.corelogic.com/trestlel/odata/Property?$top=1000&$select=*&$orderby=ListingKey&replication=true

Result

{
    "@odata.context": "https://api-prod.corelogic.com/trestle/odata/$metadata#Property/CoreLogic.DataStandard.RESO.DD.Property",
    "@odata.nextLink": "https://api-prod.corelogic.com/trestle/odata/Property/replication?id=123-a119257f-5dc0-4a47-bbb3-e526efd22656",
    "value": [
        {
            "AboveGradeFinishedArea": null,
            "AboveGradeFinishedAreaSource": null,
            "AboveGradeFinishedAreaUnits": null,
            "...": "..."
         }]
}

Code Example

https://api-prod.corelogic.com/trestle/RETS/Search?SearchType=Property&Class=Property&Query=(ListPrice = 1000000)&QueryType=DMQL2&Format=COMPACT-DECODED&Limit=1000&StandardNames=0&Select=ListingKey&Orderby=ListingKey&Count=1&Replication=true