Developers » Data API » Rest API » Response structure & Parameters » “space” parameter
“space” parameter
Sites
The &space={s:#YourSiteID#} parameter allows you to get data relative to your site.
Example: to know the number of visits per page on your site:
https://apirest.atinternet-solutions.com/data/v2/json/getData?&columns={d_page,m_visits}&sort={m_visits}&space={s:#YourSiteID#}&period={R:{D:'-1'}}&max-results=20
Level 2 sites
The &space={l2s:{s:#YourSiteID#,l2:#YourLevel2SiteID#}} parameter allows you to get data relative to a level 2 site (sub-site) of your site.
Example: to know the visit sources of a sub-section of your site:
https://apirest.atinternet-solutions.com/data/v2/json/getData?&columns={d_source,m_visits}&sort={m_visits}&space={l2s:{s:#YourSiteID#,l2:#YourLevel2SiteID#}} &period={R:{D:'-1'}}&max-results=20
Multi-sites
The &space={s:{XXXXXX,YYYYYY,ZZZZZZ}} parameter allows to you to get data relative to multiple level 1 sites at once.
Example: to know all visits generated on all my websites, mobile sites and applications in the same API call:
https://apirest.atinternet-solutions.com/data/v2/json/getData?&columns={d_site,m_visits}&sort={m_visits}&space={s:{XXXXXX,YYYYYY,ZZZZZZ}}&period={R:{D:'-1'}}&max-results=20
Please note that certain dimensions are not allowed on multi-site calls, e.g. site custom variables and any other dimensions that are site-related.
It is possible to call up to 100 sites at once.
Multi-site queries can’t be run in real time and can’t be segmented.