7Park Data API Documentation

The 7Park Data API is a service allowing clients to access our data analysis resources. Currently serving data for app user retention and usage.

Overview

Data Format

All data is returned in JSON format.

Error Handling

Errors are returned using standard HTTP error code syntax. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error (bad or missing parameters, not authenticated etc.), and codes in the 5xx range indicate an error with our servers. Any additional info is included in the body of the return call, JSON-formatted.

Authentication

All requests must include a key parameter with your unique API key.

https://api.7parkdata.com/?key=YOUR_API_KEY

Pagination

List requests may include pagination parameters for faster API access.

https://api.7parkdata.com/apps/?limit=5&offset=10
  • Parameters
    • limit (optional, number, 5) … Limit of objects to return. Default is 25. Limit is 50.
    • offset (optional, number, 10) … Skip that many objects before beginning to return objects.

Time Series Attributes

A time series is a group of data points, uniquely indentified by a set of attributes. These are those attributes.

Apps Collection

Smartphone apps or groups of apps. All application names are in English.

GET https://api.7parkdata.com/apps/?name=Facebook
Responses200
Headers
Content-Type: application/json
Body
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/apps/8826/",
      "name": "Facebook",
      "pk": 8826
    },
    {
      "self": "https://api.7parkdata.com/apps/12364/",
      "name": "Facebook at Work",
      "pk": 12364
    }
  ]
}

List Apps
GET/apps/?name={name}

URI Parameters
HideShow
name
string (optional) Example: Facebook

Name of the Apps to search for.


App

A single App object.

GET https://api.7parkdata.com/apps/8826
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/apps/8826/",
  "name": "Facebook",
  "pk": 8826
}

Get an App
GET/apps/{pk}

URI Parameters
HideShow
pk
number (required) Example: 8826

pk of the App to request.


Regions Collection

Countries or groups of countries.

GET https://api.7parkdata.com/regions/?name=World
Responses200
Headers
Content-Type: application/json
Body
{
  "count": 120,
  "next": null,
  "previous": "https://api.7parkdata.com/regions/?limit=3&offset=117",
  "results": [
    {
      "self": "https://api.7parkdata.com/regions/138/",
      "name": "Vietnam",
      "pk": 138
    },
    {
      "self": "https://api.7parkdata.com/regions/184/",
      "name": "Western Europe",
      "pk": 184
    },
    {
      "self": "https://api.7parkdata.com/regions/156/",
      "name": "World",
      "pk": 156
    }
  ]
}

List Regions
GET/regions/?name={name}

URI Parameters
HideShow
name
string (optional) Example: World

Name of the Regions to search for.


Region

A single Region object.

GET https://api.7parkdata.com/regions/156
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/regions/156/",
  "name": "World",
  "pk": 156
}

Get a Region
GET/regions/{pk}

URI Parameters
HideShow
pk
number (required) Example: 156

pk of the Region to request.


Periods Collection

Data point time intervals. Data points can be aggregated by day, week, etc.

GET https://api.7parkdata.com/periods/?name=week
Responses200
Headers
Content-Type: application/json
Body
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/periods/3/",
      "name": "Day",
      "pk": 3
    },
    {
      "self": "https://api.7parkdata.com/periods/2/",
      "name": "Week",
      "pk": 2
    }
  ]
}

List Periods
GET/periods/?name={name}

URI Parameters
HideShow
name
string (optional) Example: week

Name of the Periods to search for.


Period

A single Period object.

GET https://api.7parkdata.com/periods/2
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/periods/2/",
  "name": "Week",
  "pk": 2
}

Get a Period
GET/periods/{pk}

URI Parameters
HideShow
pk
number (required) Example: 2

pk of the Period to request.


Metrics Collection

Data metrics. Daily Active Users, Minutes Per Session, etc.

GET https://api.7parkdata.com/metrics/?name=Retention
Responses200
Headers
Content-Type: application/json
Body
{
  "count": 15,
  "next": "https://api.7parkdata.com/metrics/?limit=3&offset=3",
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/metrics/16/",
      "name": "Active User Index",
      "pk": 16
    },
    {
      "self": "https://api.7parkdata.com/metrics/17/",
      "name": "Active Users / Install Base",
      "pk": 17
    },
    {
      "self": "https://api.7parkdata.com/metrics/5/",
      "name": "DAU",
      "pk": 5
    }
  ]
}

List Metrics
GET/metrics/?name={name}

URI Parameters
HideShow
name
string (optional) Example: Retention

Name of the Metrics to search for.


Metric

A single Metric object.

GET https://api.7parkdata.com/metrics/5
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/metrics/5/",
  "name": "DAU",
  "pk": 5
}

Get a Metric
GET/metrics/{pk}

URI Parameters
HideShow
pk
number (required) Example: 5

pk of the Metric to request.


Cohorts Collection

Groups of users. All users, teens, etc.

GET https://api.7parkdata.com/cohorts/?name=all
Responses200
Headers
Content-Type: application/json
Body
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/cohorts/2/",
      "name": "All Users",
      "pk": 2
    }
  ]
}

List Cohorts
GET/cohorts/?name={name}

URI Parameters
HideShow
name
string (optional) Example: all

Name of the Cohorts to search for.


Cohort

A single Cohort object.

GET https://api.7parkdata.com/cohorts/2
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/cohorts/2/",
  "name": "All Users",
  "pk": 2
}

Get a Cohort
GET/cohorts/{pk}

URI Parameters
HideShow
pk
number (required) Example: 2

pk of the Cohort to request.


App Retention

App user retention time series and data.

App Retention Time Series Collection

Time series of App Retention data points. Can be filtered by the above attributes. When all attributes are provided, will return a single unique object.

GET https://api.7parkdata.com/app_retention/?metric=2&period=2& region=133&cohort=2&app=6683
Responses200
Headers
Content-Type: application/json
Body
{
  "count": null,
  "next": null,
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/app_retention/43285/",
      "data": "https://api.7parkdata.com/app_retention/43285/data/",
      "metric": "https://api.7parkdata.com/metrics/2/",
      "period": "https://api.7parkdata.com/periods/2/",
      "region": "https://api.7parkdata.com/regions/133/",
      "cohort": "https://api.7parkdata.com/cohorts/2/",
      "app": "https://api.7parkdata.com/apps/6683/",
      "pk": 43285
    }
  ]
}

List App Retention Time Series
GET/app_retention/?metric={metric}&period={period}& region={region}&cohort={cohort}&app={app}

URI Parameters
HideShow
metric
number (optional) Example: 2

pk of the Metric to filter for.

period
number (optional) Example: 2

pk of the Period to filter for.

region
number (optional) Example: 133

pk of the Region to filter for.

cohort
number (optional) Example: 2

pk of the Cohort to filter for.

app
number (optional) Example: 6683

pk of the App to filter for.


App Retention Time Series

A single App Retention time series object.

GET https://api.7parkdata.com/app_retention/16
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/app_retention/16/",
  "data": "https://api.7parkdata.com/app_retention/16/data/",
  "metric": "https://api.7parkdata.com/metrics/2/",
  "period": "https://api.7parkdata.com/periods/2/",
  "region": "https://api.7parkdata.com/regions/186/",
  "cohort": "https://api.7parkdata.com/cohorts/2/",
  "app": "https://api.7parkdata.com/apps/10707/",
  "pk": 16
}

Get an App Retention Time Series
GET/app_retention/{pk}

URI Parameters
HideShow
pk
number (required) Example: 16

pk of the App Retention time series to request.


App Retention Data Collection

App Retention data points.

GET https://api.7parkdata.com/app_retention/16/data
Responses200
Headers
Content-Type: application/json
Body
{
  "count": null,
  "next": null,
  "previous": null,
  "results": [
    {
      "x": "2016-01-16",
      "y": [
        1,
        0.9681,
        0.964,
        0.9609,
        0.9585,
        0.9546,
        0.9528,
        0.9509,
        0.9499,
        0.9476,
        0.9463,
        0.9461,
        0.9443,
        0.9423
      ]
    },
    {
      "x": "2016-01-09",
      "y": [
        1,
        0.969,
        0.964,
        0.9608,
        0.958,
        0.956,
        0.9519,
        0.9506,
        0.949,
        0.9478,
        0.9453,
        0.9441,
        0.9436,
        0.9417
      ]
    }
  ]
}

List App Retention Data
GET/app_retention/{series}/data

URI Parameters
HideShow
series
number (required) Example: 16

pk of the App Retention time series to request.


App Usage

App Usage time series and data.

App Usage Time Series Collection

Time series of App Usage data points. Can be filtered by the above attributes. When all attributes are provided, will return a single unique object.

GET https://api.7parkdata.com/app_usage/?metric=6&period=2& region=156&cohort=2&app=6683
Responses200
Headers
Content-Type: application/json
Body
{
  "count": null,
  "next": null,
  "previous": null,
  "results": [
    {
      "self": "https://api.7parkdata.com/app_usage/9110891/",
      "data": "https://api.7parkdata.com/app_usage/9110891/data/",
      "metric": "https://api.7parkdata.com/metrics/6/",
      "period": "https://api.7parkdata.com/periods/2/",
      "region": "https://api.7parkdata.com/regions/156/",
      "cohort": "https://api.7parkdata.com/cohorts/2/",
      "app": "https://api.7parkdata.com/apps/6683/",
      "pk": 9110891
    }
  ]
}

List App Usage Time Series
GET/app_usage/?metric={metric}&period={period}& region={region}&cohort={cohort}&app={app}

URI Parameters
HideShow
metric
number (optional) Example: 6

pk of the Metric to filter for.

period
number (optional) Example: 2

pk of the Period to filter for.

region
number (optional) Example: 156

pk of the Region to filter for.

cohort
number (optional) Example: 2

pk of the Cohort to filter for.

app
number (optional) Example: 6683

pk of the App to filter for.


App Usage Time Series

A single App Usage time series object.

GET https://api.7parkdata.com/app_usage/55
Responses200
Headers
Content-Type: application/json
Body
{
  "self": "https://api.7parkdata.com/app_usage/55/",
  "data": "https://api.7parkdata.com/app_usage/55/data/",
  "metric": "https://api.7parkdata.com/metrics/15/",
  "period": "https://api.7parkdata.com/periods/3/",
  "region": "https://api.7parkdata.com/regions/240/",
  "cohort": "https://api.7parkdata.com/cohorts/2/",
  "source": "https://api.7parkdata.com/sources/2/",
  "app": "https://api.7parkdata.com/apps/11389/",
  "pk": 55
}

Get an App Usage Time Series
GET/app_usage/{pk}

URI Parameters
HideShow
pk
number (required) Example: 55

pk of the App Usage time series to request.


App Usage Data Collection

App Usage data points.

GET https://api.7parkdata.com/app_usage/55/data
Responses200
Headers
Content-Type: application/json
Body
{
    "count": null,
    "next": null,
    "previous": null,
    "results": [
        {
            "x": "2014-03-30",
            "y": 1.0,
        },
        {
            "x": "2014-03-31",
            "y": 2.5,
        }
    ]
}

List App Usage Data
GET/app_usage/{series}/data

URI Parameters
HideShow
series
number (required) Example: 55

pk of the App Usage time series to request.


Example Requests

Python

from requests import Session

# Define the API URL
base_url = 'https://api.7parkdata.com/'

# Create a Requests session
session = Session()

# Add your API key
session.params.update(key='YOUR_API_KEY')

# Get Metric PK
response = session.get(base_url + 'metrics/', params={'name': 'DAU'})
metric_pk = response.json()['results'][0]['pk']

# Get Period PK
response = session.get(base_url + 'periods/', params={'name': 'Week'})
period_pk = response.json()['results'][0]['pk']

# Get Region PK
response = session.get(base_url + 'regions/', params={'name': 'USA'})
region_pk = response.json()['results'][0]['pk']

# Get Cohort PK
response = session.get(base_url + 'cohorts/', params={'name': 'All Users'})
cohort_pk = response.json()['results'][0]['pk']

# Get App PK
response = session.get(base_url + 'apps/', params={'name': 'Facebook'})
app_pk = response.json()['results'][0]['pk']

# Get Series Data URL
response = session.get(base_url + 'app_usage/', params={
    'metric': metric_pk,
    'period': period_pk,
    'region': region_pk,
    'cohort': cohort_pk,
    'app': app_pk,
})
series_data_url = response.json()['results'][0]['data']

# Get Data Points
response = session.get(series_data_url)
data_points = response.json()['results']

# Loop through Data Points and print x, y values
for data_point in data_points:
    print str(data_point['x']) + ', ' + str(data_point['y'])

Generated by aglio on 05 May 2016