Not possible/Seek alternatives
Screen Time for iOS
I’m not sure if Apple has announced an API for the newly announced ScreenTime features, but it’d be nice to see how using my iPhone/iPad correlates with other metrics.
Not possible due to no API.
I’m not sure if Apple has announced an API for the newly announced ScreenTime features, but it’d be nice to see how using my iPhone/iPad correlates with other metrics.
Not possible due to no API.
We probably won’t be looking into replicating what Moment does, as there’s a significant amount of work there for what would be a fairly small part of Exist overall. But you might like to vote for this suggestion for manual tracking, which would allow manual entry for phone screen time.
RescueTime tracks mobile time for iOS, and while it drains the battery faster and requires continual location access, there is a way to access it from their API, according to their support:
“Try adding restrict_source_type=mobile
to your API queries. (the possible values are ‘computers’, ‘mobile’, and ‘offline’)”
Update: Screentime for iPhone does work.
```python def get_mobile_minutes(date): “”“given the date as a formatted string, returns mobile minutes as an int”“” headers = {‘key’: api_token}
data = requests.get('https://www.rescuetime.com/anapi/data?key='+api_token+'&restrict_source_type=mobile&format=json&restrict_begin='+date+'&restrict_end='+date).text
minutes_spent_on_date = json.loads(data)['rows'][0][1]//60
return minutes_spent_on_date```
This will return the number of mobile minutes for a given date
Let me try making the code look better:
def get_mobile_minutes(date):
“”“given the date as a formatted string, returns mobile minutes as an int”“”
headers = {‘key’: api_token}
data = requests.get('https://www.rescuetime.com/anapi/data?key='+api_token+'&restrict_source_type=mobile&format=json&restrict_begin='+date+'&restrict_end='+date).text
minutes_spent_on_date = json.loads(data)['rows'][0][1]//60
return minutes_spent_on_date