Introduction
The ESPC Reporting API allows authorised users to query a variety of performance metrics for properties across the website, in member portal and BDP.
The primary API endpoint is based upon the Google Analytics v3 API, so we hope that it is familiar to developers.
Version History
| Version | Date | Notes |
|---|---|---|
| 1.6 | 2026-08-31 | Added case_ref for new ESPC case reference form |
| 1.5 | 2026-05-08 | Added RightmoveSearch and RightmoveClick metrics. |
| 1.4 | 2026-02-11 | Added ESPC.com property id to dimensions. |
| 1.3 | 2024-11-21 | Added month, cal_hour and week time metrics. |
| 1.2 | 2024-04-12 | Included RightmoveLead metric. |
| 1.1 | 2022-02-14 | Added availability API. |
| 1.0 | 2021-12-01 | First public release |
Authentication
curl "https://reporting.espc.com/api/data?date-from=2021-10-01&...."
-H "ESPC-Auth: ESPC:KEY"
$ch = curl_init('https://reporting.espc.com/api/data');
curl_setopt($ch,CURLOPT_HTTPHEADER,'ESPC-Auth: ESPC:KEY');
...
curl_exec($ch);
To authorize, use a valid API Key in either the request header or the query string parameters:
The Request Header is ESPC-Auth.
The query string parameter that you can use is key. Watch that the ":"
in the key gets the proper treatment (%3A) if you're sending it in the query string.
$ch = curl_init('https://reporting.espc.com/api/data?key=ESPC:KEY');
...
curl_exec($ch);
curl "https://reporting.espc.com/api/data?date-from=2021-10-01&....&key=ESPC:KEY"
We don't recommend that you use both the header and the query string options in the same request, particularly with different keys. But if you do then the request header takes priority.
Make sure to replace ESPC:KEY in these examples with your own API key.
Data Availability API
Most reporting data is updated once a day, in an overnight batch job. Some jobs will collect this data once a day and store it for its own purposes, and some clients will want to query the data dynamically and display a graph of values (for example), and in these cases, it's a good idea to know that the data you are after is available in the database.
Two convenience methods are available to test which data sets are available to be reported on for a day, or a range of dates,
/api/check/range will check a date range (start-date andend-date parameters) that all the data is available and /api/check/date (specify the date parameter) checks for data on a specific date.
Along with the date range, you must also specify the data source that you are requesting in the service parameter. Possible values are:
| Service | Data to query |
|---|---|
| ESPC | property search, click and view activity from ESPC.COM |
You need a valid reporting API key to call the availability API, but any valid key will do, it's not restricted to any particular firm or user.
The check API call will return 200 OK ("OK") if the data you are asking about is available in the reporting solution, a 404 not found error response ("Data not available for date/range") if the data is not yet available.
Check for data for a specific date.
curl "https://reporting.espc.com/api/check/date?date=2021-09-07&service=ESPC \
-H "ESPC-Auth: ESPC:KEY"
$params = [];
$params['date'] = '2021-09-01';
$params['service'] = 'ESPC';
$url = 'https://reporting.espc.com/api/check/date?';
$url .= http_build_query($params);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_HTTPHEADER,'ESPC-Auth: ESPC:KEY');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$result = curl_exec($ch);
Check for data over a date range.
curl "https://reporting.espc.com/api/check/range?date-from=2021-09-01&date-to=2021-09-07&service=ESPC \
-H "ESPC-Auth: ESPC:KEY"
$params = [];
$params['date-from'] = '2021-09-01';
$params['date-to'] = '2021-09-07';
$params['service'] = 'ESPC';
$url = 'https://reporting.espc.com/api/check/range?';
$url .= http_build_query($params);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_HTTPHEADER,'ESPC-Auth: ESPC:KEY');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$result = curl_exec($ch);
Reporting
Query Reporting Data
Retrieve core reporting data from the api/data endpoint.
HTTP Request
GET https://reporting.espc.com/api/data
Retrieve all the times a property has appeared in the search results, in the first week in September:
curl "https://reporting.espc.com/api/data?metrics=PropertySearched&\
date-from=2021-09-01&date-to=2021-09-07&\
dimensions=day&ids=property:467567&output=json" \
-H "ESPC-Auth: ESPC:KEY"
$params = [];
$params['metrics'] = 'PropertySearched';
$params['date-from'] = '2021-09-01';
$params['date-to'] = '2021-09-07';
$params['dimensions'] = 'day';
$params['ids'] = 'property:467567';
$params['output'] = 'json';
$url = 'https://reporting.espc.com/api/data?';
$url .= http_build_query($params);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_HTTPHEADER,'ESPC-Auth: ESPC:KEY');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$result = curl_exec($ch);
The above command returns JSON structured like this:
[
{"by_day":"2021-09-02","subtotal":559},
{"by_day":"2021-09-01","subtotal":925},
{"by_day":"2021-09-03","subtotal":50},
{"by_day":"2021-09-06","subtotal":52},
{"by_day":"2021-09-07","subtotal":29},
{"by_day":"2021-09-04","subtotal":26},
{"by_day":"2021-09-05","subtotal":27}
]
Query Parameters
| Parameter | Default | Required | Description |
|---|---|---|---|
| key | The ESPC API Key, if not supplied in the request headers. | ||
| start-date | yesterday | The first day of data that you would like to query, formatted as YYYY-MM-DD. | |
| end-date | yesterday | The latest day of data that you would like to query formatted as YYYY-MM-DD. | |
| ids | yes | A list of comma-separated objects that you would like to report on, see IDs. | |
| metrics | yes | A list of comma-separated events that you would like to report on, see Metrics. | |
| dimensions | day | A list of comma-separated reporting dimensi;ons that you would like to group the report results into. A maximum of three dimensions may be specified, see Dimensions. | |
| output | json | The output format you would like, this may be synonyms of json, csv or dataTable. The default is json, see Outputs. |
Examples
Search performance for a property
We want to measure how often a property is viewed - in search results and in detail - on espc.com for the month of August.
| Parameter | Value |
|---|---|
| start-date | 2021-08-01 |
| end-date | 2021-08-31 |
| ids | property:47886 |
| metrics | PropertySearched,PropertyViewed |
| dimensions | day,event |
| output | dataTable |
Query
GET https://reporting.espc.com/api/data?start-date=2021-08-01&end-date=2021-08-31&ids=property:47886&metrics=PropertySearched,PropertyViewed&dimensions=day,event&output=dataTable&key=ESPC:KEY
Viewing Requests for a branch
A BDP firm would like to see how many contact requests were intiated for each of their properties in the first week of July, and download it for use in Excel..
| Parameter | Value |
|---|---|
| start-date | 2021-07-01 |
| end-date | 2021-07-07 |
| ids | bdp_branch:190 |
| metrics | ContactRequested |
| dimensions | bdp_id |
| output | csv |
Query
GET https://reporting.espc.com/api/data?start-date=2021-07-01&end-date=2021-08-07&ids=bdp_branch:190&metrics=ContactRequests&dimensions=bdp_id&output=csv&key=ESPC:KEY
IDs
Every report is generated about one or more specific objects. Specify the type of
object and their id together with a :, e.g. property_id:12345.
You must specify at least one id to create a successful report. Specify all the relevant objects in the query as a comma-separated list.
You may query on any of the following reporting data objects.
A report will OR these values to retreive every matching record, e.g. a request including the ids parameter: ids=reg:12345,case:98760 will match records for both ESPC Registration ID 12345, and for the case ID 98760 - potentially two properties.
Use the dimensions parameter to ensure that the output distinguishes between different ids, as required.
| ID name | Description |
|---|---|
| case:12345 | The property case id from Member Portal |
| reg:12345 | The property marketing registration id |
| firm:12345 | The ESPC Member Portal firm Id |
| org:12345 | The ESPC organisation id |
| bdp_id:12345 | The property id from BDP |
| bdp_branch:12345 | The BDP branch id |
| bdp_firm:12345 | The BDP firm id |
If your API Key is not authorised to query the specific IDs that you include in the query, an empty set will be returned.
Metrics
The following events are available as part of the core property reporting interface.
To report on these events, add them as comma-separated values to the metrics
parameter in a reporting query.
These events are tracked and listed against an individual property. If you are reporting at a higher level, for instance for a member firm or branch, these values are for all properties under management at that location.
| Event Name | Description |
|---|---|
| PropertySearched | The specified property appears in the property search results. |
| SearchClicked | The user clicks on the property in the search results for more detail. |
| PropertyViewed | The main web page for this property is viewed. |
| FloorPlanViewed | The user opens the floorplan media for a property. |
| MapClicked | The user views the property location. |
| VirtualTourClicked | The user views a virtual tour link. |
| VideoClicked | The user views a video tour link. |
| ScheduleDownloaded | The user downloads a PDF schedule for a property. |
| HomeReportRequested | The user completes a Home Report Request. |
| PropertyShortlisted | The user adds a property to their shortlist/watchlist. |
| DigitalBrochureClicked | The user views or downloads a digital brochure for a property. |
| EmailClicked | The user clicks on a property details link in an alert/saved-search email. |
| ContactRequested | A user has completed an enquiry form about the property |
| SavedSearch | A user has saved a search that includes this property. |
| RightmoveLead | An enquiry has been recveived from Rightmove about this property. |
| RightmoveSearch | The property appeared in Rightmove's search results. |
| RightmoveClick | The property's full listing was viewed on Rightmove. |
Note that not all metrics are available for ESPC members, and some may require an active BDP subscription.
Dimensions
Dimensions describe the primary vectors that will be returned in the reporting data.
You may specify up to three dimensions in a single reporting query, as comma-separated
values in the dimensions parameter.
| Dimension | Description |
|---|---|
| General | |
| type | Return report data grouped by event type |
| event | Synonym for type |
| Time | |
| day | Return report data grouped by the calendar date. |
| hour | Return report data grouped by hour-of-day |
| month | Return report data grouped by month |
| week | Report data grouped by week (starting on a Monday) |
| cal_hour | Return report data grouped by hour with the date explicit. (See below for the difference between this and hour dimensinos.) |
| clock_hour | Subtotals by hour of day (ie. a maximum of 24 result rows) |
| ESPC | |
| case | Return report data grouped by ESPC Case reference. |
| reg_id | Return report data grouped by ESPC Registration ID. |
| property_id | Return report data grouped by ESPC.com property id (the number in the property URL on espc.com) |
| org_id | Return report data grouped by ESPC Organisation ID |
| firm_id | Return report data grouped by ESPC Firm ID |
| BDP | |
| bdp_firm | Return report data grouped by BDP firm id. |
| bdp_branch | Return report data grouped by BDP branch id. |
| bdp_property | Return report data grouped by BDP property id. |
| bdp_id | A synonym for bdp_property. |
Notes:
Case references
Because of changes to the underlying application, case references have changed from a number (3044534) to a
reference string ('C-178-6668'). The case dimension filters on both. However, if you want to, you can
use either case_id for the old number or case_ref for the new string values.
Grouping by hour
When grouping by hour, the cal_hour dimension will return the hour with the date included in the column
data (e.g. "2022-07-23:12" for 12pm on July 23rd, 2022). The hour dimension will just return the hour
of the day, (e.g. "00" to "23"). Additionally, clock_hour will subtotal each wallclock hour (eg 00,
01... 23) across the time range specified, so providing a snapshot of activity based on time of day.
The same data is returned in all cases, but it is grouped differently based upon your required use case.
In particular, the hour dimension does not subtotal the same hour across multiple days. Running a
query over seven days will return seven distinct values for "09", etc. Using Calendar Hour will allow
you one further dimension in a query where you might want to include both hour and day, but might
complicate your data processing if you rely on the hour being a number. Clock hour is for data nerds.
Output Formats
Query results can be returned in a number of formats.
CSV example
by_date, by_property, subtotal
2021-09-01,1234,900
2021-09-01,8888,276
2021-09-02,1234,787
2021-09-02,8888,138
JSON example
[
{
"by_date": "2021-09-01",
"by_property": "1234",
"subtotal": 900
},
{
"by_date": "2021-09-01",
"by_property": "8888",
"subtotal": 276
},
{
"by_date": "2021-09-02",
"by_property": "1234",
"subtotal": 787
},
{
"by_date": "2021-09-02",
"by_property": "8888",
"subtotal": 138
}
]
DataTable example
{
"cols": [
{"id": "by_date", "label": "by_date", "type": "string"},
{"id": "by_property", "label": "by_property", "type": "string"},
{"id": "subtotal", "label": "subtotal", "type": "number"}
],
"rows": [
{"c": [
{"v": "2021-09-01"},
{"v": "1234"},
{"v": 900 }
]},
{"c": [
{"v": "2021-09-01"},
{"v": "8888"},
{"v": 276 }
]},
{"c": [
{"v": "2021-09-02"},
{"v": "1234"},
{"v": 787 }
]},
{"c": [
{"v": "2021-09-02"},
{"v": "8888"},
{"v": 138 }
]}
]
}
The output from a successful reporting API call is a data table containing at most four
columns - each dimension specified will be returned as a column, and the final column
returns the number of records we have that match the specific query and dimension values.
You may specify how you would like this table returned in the output parameter.
| Parameter | Output |
|---|---|
| output=json | JSON |
| output=text | JSON |
| output=js | JSON |
| output=data | DataTable |
| output=datatable | DateTable |
| output=gdt | DataTable |
| output=csv | CSV |
Errors
The ESPC Reporting API may return the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- You have provided a malformed request, check the error message returned. |
| 401 | Unauthorized -- Your API key is wrong. |
| 404 | Not Found -- The specified api endpoint could not be found. |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |