website logo
⌘K
Quickstart
User
Metrics
Webhooks
Mobile SDK
V2
React Native
Flutter
Android (Kotlin)
Swift
V1
Errors
FAQ
Docs powered by
Archbee

Quickstart

To get started with the Spike API first create an account, by signing up at https://spikeapi.com. Once approved you'll have access to the Spike developer console.

Once you have these credentials you can begin using Spike API.

You can click on the "Run in Postman" button below to interact with our API.

<div class="postman-run-button"
data-postman-action="collection/fork"
data-postman-visibility="public"
data-postman-var-1="28147731-dfeaef05-2c45-4aae-8e2c-4da15fc0f9aa"
data-postman-collection-url="entityId=28147731-dfeaef05-2c45-4aae-8e2c-4da15fc0f9aa&entityType=collection&workspaceId=ed6fe3e5-b54c-4ff5-96ec-388a444397ad"></div>
<script type="text/javascript">
  (function (p,o,s,t,m,a,n) {
    !p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
    !o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
      (n = o.createElement("script")),
      (n.id = s+t), (n.async = 1), (n.src = m), n
    ));
  }(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>


Integration initialization

For a user to establish connections with data providers, applications need to launch the integration flow, which entails opening Spike's integration webpage on the user's browser.

https://api.spikeapi.com/init-user-integration/

Required parameters:

client_id (string) App ID for your team.

provider (string) name of the data provider.

user_id (string) A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information should not be used in the user_id.



Providers

Provider

Short name

Apple Health* (SDK)

apple

Android Health Connect* (SDK)

health_connect

Dexcom

dexcom

Dexcom Sandbox

dexcom_sandbox

Fitbit

fitbit

Garmin

garmin

Google Fit

google_fit

Oura

oura

Polar

polar

Spotify

spotify

Strava

strava

Withings

withings

Whoop

whoop

Suunto**

suunto

Omron**

omron

Wahoo**

wahoo

Biostrap

biostrap

Samsung Health (Data is available via Health Connect SDK)

-

MyFitnessPal(Data is available via Health Connect SDK)

-

Xiaomi(Data is available via Health Connect SDK)

-

*Please, use iOS SDK (Swift, React Native, Flutter, or Android-Kotlin) to connect to Apple Health and Android Health Connect.

** Request access

URL Example

https://api.spikeapi.com/init-user-integration/?provider=fitbit&user_id=00001c&client_id=ea9e03f5-333-1111-2222-47a88c184c3b

Integration Flow

*The screens shown above are for illustrative purposes only and do not represent the actual provided screens.
*The screens shown above are for illustrative purposes only and do not represent the actual provided screens.




Users will be redirected to a data provider website and users will be asked to submit authentication details. Once the user authorizes access to their data, Spike returns the user back to the application using the postback URL. (You can edit it on the developer console). Appended to the postback URL is the Spike user ID. Following is an example of the postback URL with the user ID highlighted:

https://my_test_app.com/callback?provider=fitbit&customer_user_id=00001c&user_id=fa1e3803-6068-4ea7-9788-eccce210d30c

Please save it and use it for all user data requests.



Get data from devices

user_id (string) Key returned by Spike connect device request. This key should be stored in your database against the user and used for all interactions with the Spike API.

start_data (date) Date from in YYYY-MM-DD format

end_data (date) Date to in YYYY-MM-DD format

x-spike-auth (string) Application token from Spike console.

Python
|
import requests

url = "https://api.spikeapi.com/metrics/calories/?user_id=282812818&start_date=2020-05-01&end_date=2020-05-03"
headers = {}
headers['x-spike-auth'] = 'fa0b3803-1111-2222-9788-eccce210d30c'
response = requests.request("GET", url, headers=headers)

print(response.text)




Did this page help you?
NEXT
Add User Integration
Docs powered by
Archbee
TABLE OF CONTENTS
Integration initialization
Required parameters:
Providers
URL Example
Integration Flow
Get data from devices
Docs powered by
Archbee