curl --request GET \
--url https://api.habitify.me/v2/habits \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.habitify.me/v2/habits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.habitify.me/v2/habits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.habitify.me/v2/habits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.habitify.me/v2/habits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.habitify.me/v2/habits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.habitify.me/v2/habits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"icon": "<string>",
"colorHex": "<string>",
"type": "good",
"description": "<string>",
"occurrence": {
"type": "daily"
},
"startDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"logMethod": "manual",
"goals": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"periodicity": "daily",
"value": 123,
"unit": "m",
"isActive": true
}
],
"challengeId": "<string>",
"reminders": {
"timeTriggers": [
{
"time": {
"hour": 11,
"minute": 29
},
"occurrenceFilter": {
"weekDays": [
1
]
},
"showLiveActivity": true,
"showAsAlarm": true
}
],
"habitStacks": [
{
"conditionHabitId": "<string>",
"type": "<string>",
"timerType": "<string>",
"timerDelaySecs": 123,
"id": "<string>"
}
]
},
"endCondition": {
"id": "<string>",
"type": "date",
"createdAt": "2023-11-07T05:31:56Z",
"isMet": true,
"date": "2023-12-25"
},
"customUnitName": "<string>",
"areas": [
{
"id": "<string>",
"name": "<string>",
"colorHex": "<string>",
"icon": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"timeOfDays": [
{
"id": "<string>",
"name": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"colorHex": "<string>",
"icon": "<string>"
}
]
}
],
"pagination": {
"total": 123,
"limit": 123,
"offset": 123
}
}Get all habits
Retrieve a paginated list of your habits. Supports filtering by archived status, area, type, time of day, and scheduled date.
curl --request GET \
--url https://api.habitify.me/v2/habits \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.habitify.me/v2/habits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.habitify.me/v2/habits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.habitify.me/v2/habits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.habitify.me/v2/habits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.habitify.me/v2/habits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.habitify.me/v2/habits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"icon": "<string>",
"colorHex": "<string>",
"type": "good",
"description": "<string>",
"occurrence": {
"type": "daily"
},
"startDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"logMethod": "manual",
"goals": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"periodicity": "daily",
"value": 123,
"unit": "m",
"isActive": true
}
],
"challengeId": "<string>",
"reminders": {
"timeTriggers": [
{
"time": {
"hour": 11,
"minute": 29
},
"occurrenceFilter": {
"weekDays": [
1
]
},
"showLiveActivity": true,
"showAsAlarm": true
}
],
"habitStacks": [
{
"conditionHabitId": "<string>",
"type": "<string>",
"timerType": "<string>",
"timerDelaySecs": 123,
"id": "<string>"
}
]
},
"endCondition": {
"id": "<string>",
"type": "date",
"createdAt": "2023-11-07T05:31:56Z",
"isMet": true,
"date": "2023-12-25"
},
"customUnitName": "<string>",
"areas": [
{
"id": "<string>",
"name": "<string>",
"colorHex": "<string>",
"icon": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"timeOfDays": [
{
"id": "<string>",
"name": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"colorHex": "<string>",
"icon": "<string>"
}
]
}
],
"pagination": {
"total": 123,
"limit": 123,
"offset": 123
}
}Authorizations
API key generated from our app (Settings > API). Only one key can be active at a time.
Query Parameters
Filter by archived status. If true, returns only archived habits. If false, returns only active habits.
Filter by area ID to return only habits assigned to a specific area
Filter by habit type (good or bad) Indicates whether a habit is something you want to build or break. A "good" habit is one you want to maintain or increase (e.g., exercise, reading). A "bad" habit is one you want to reduce or eliminate (e.g., smoking, excessive screen time).
good, bad Filter by time-of-day period ID
Maximum number of habits to return per page
1 <= x <= 100Number of habits to skip for pagination
x >= 0
