An http interface for exported json-files from BigPaua's Arc App.
The json-exports are accessed and staged through multiple layers:
yyyy-mm-dd.json
and yyyy-mm.json
)The intention is to provide a base for further analysis of the data.
config/directories.json
The paths to the directories are specified here.
layer1
: iCloud directory where Arc stores its daily json.gz outputslayer2
: Local directory (defaults to arc-data/jsonexport
), containing uncompressed json filesconfig/classifications.json
Place classifications can be used to classify multiple places, for example determining workplaces and home locations (in order to analyse commutes). It references Arc places by the place.name
attribute.To separate standard config file and your own values, you can copy the files from <configfile>.json
to <configfile>.mine.json
. The .mine
-file will be read preferrably. Their changes will not be tracked to github.
It is advised to set the setting layer2.autoLoadOnStart = true
so the timeline files from Layer 2 are read from disk on server startup. If the setting is set to false, the files will be read on first data query and will delay response time.
/files/source/list
Lists the compressed source files (Layer 1)/files/extract
Copies/extracts the files from Layer 1 (iCloud) to Layer 2 (local directory). Checks for duplicates in the iCloud directory on the way. /files/jsonexport/reload
needs to be called afterwards to load the new files into memory./files/jsonexport/list
Lists all the Arc export files (Layer 2)/files/jsonexport/reload
Reloads the json exports from disk into memory (e.g. after /files/extract
has run)/files/status
Returns a status of Layer 1, Layer 2, and the classifications (last loading times, file count)/classifications/places
Shows the place classifications maintained in config/classifications.json
/classifications/reload
Reloads config/classifications.json
/visits/places
Shows a list of all the places that were visited. Can be filtered./visits/places/unassigned
Shows a list of visits that don't have an assigned place. Can be filtered./activities/types
Shows a list of all activity types. Can be filtered./timelineItems/list
Shows a (human-readable) list of timelineItems. Can be filtered./timelineItems/timestamps
Shows a list of timestamps. Can be filtered.You can optionally filter the queried timelineItems with the following URL-Parameters:
type=visits
Shows only visits.type=activities
Shows only activities./timelineItems/timestamps?type=visits
from=2019-03-01
From-Dateto=2019-03-15
To-Dateweekday=Mo,Fr
A (comma-separated) list of weekdays (first two letters)/activities/types?from=2019-01-01&to=2019-01-31&weekday=Mo
activityType=cycling,boat
A (comma-separated) list of activity types/timelineItems/timestamps?activityType=cycling
duration_from=30
Minimum duration in minutesduration_to=60
Maximum duration in minutes/timelineItems/list?activityType=cycling&duration_from=60
place=Bakery,Café
A (comma-separated) list of exact match place namesplaceClass=home
A place classification, maintained in config/classifications.json
placeUnassigned=1
Only show items with unassigned place/timelineItems/list?placeClass=work
/timelineItems/list?place=Mom and Dads
/timelineItems/list?placeUnassigned=1&type=visits
, same as /visits/places/unassigned
placeFrom=Bakery,Café
A (comma-separated) list of exact match place namesplaceFromClass=home
A place classification, maintained in config/classifications.json
placeTo=Supermarket
A (comma-separated) list of exact match place namesplaceToClass=work
A place classification, maintained in config/classifications.json
timelineItems/list
fields=startDate,duration
A (comma-separated) list of the desired fields. Possibilities are listed in the wiki./timelineItems/list?from=2019-03-01&to=2019-03-01&fields=itemId,nextItemId,previousItemId,startDate,endDate,samples,radius,altitude,center,activityType,activeEnergyBurned,stepCount,isVisit,floorsAscended,floorsDescended,averageHeartRate,maxHeartRate,place,streetAddress,manualPlace,placeId,uncertainActivityType,manualActivityType,activityTypeConfidenceScore,duration,durationHuman,distanceToPlace,bearingToPlace
timelineItems/list
limit=50
Limit the number of returned timelineItems (Standard: no limit, thus no pagination)offset=100
(optional) The number of items to skip.page=2
(optional) The desired page number, starting at 1. Can be used to avoid specifying the offset, which it will override. Will calculate offset = limit * (page - 1)
./timelineItems/list?fields=itemId&limit=50&page=2
- same as /timelineItems/list?fields=itemId&limit=50&offset=50
cd
to this directorynpm install
npm run dev