Price Alerts

FREEMIUM
By APITechHub | Updated 한 달 전 | Financial
Popularity

5.3 / 10

Latency

295ms

Service Level

100%

Health Check

100%

README

API Description

To begin receiving notifications, it is necessary to establish your domain and provide evidence of server ownership.

It can be accomplish by 3 simple steps:

  * It is important to pay attention on the details in the following steps

  * To simplify the steps assume that your REST API is `https://example.com/api`

  * be aware our system is communicating with HTTPS only

The steps

  1. Get your wellknown key (dkey) from our API /api/getWellKnownStats
  2. Make sure that the dkey given to you by our API is accessible at https://example.com/.well-known/apihubtech-alerts/your_dkey
  3. The final step is to set your domain example.com (NOT THE FULL API URL) to our system using the /api/setWellKnown API

Thats it you are done!

  • as soon as our system receives your domain it will make an http challenge to verify that your dkey is present and mark your domain as verified
  • from there on you can start adding price alerts API (/api/add)
  • You can check the domain verification status by calling our API /api/getWellKnownStats
  • be aware that your key must be present as long as you are using our services
  • in case the domain is changed, then the verification process must be done again

API Documentation




1) WellKnown Section


1.1) Get domain's (wellknown) stats

> From this API can retrieve the domain status and the dkey, which the dkey is required by our system for verifying your domain ownership.

API Method
/api/getWellKnownStats GET

Example Request

curl --location 'https://price-alerts1.p.rapidapi.com/api/getWellKnownStats'

Example Response

  {
        "status": "ok",
        "data": {
              "dkey": "DE27FA4B453A4119B0F28EB51E1119975E970DFB",
              "domain": example.com,
              "verified": 0,
              "attempts_left": 3,
              "http_code": 404,
              "retry_at": "2023-06-11 17:26:24"
        }
  }

Response Fields

Field Example Description
domain example.com The domain of the server you wish to receive alerts (can be set using /setWellKnown API)
dkey DE27FA4B453A4119B0F28EB51E1119975E970DFB The dkey is the key you are requested to add on your server to proof server ownership
verified 0 Denotes if the given domain has the given dkey at https://your_domain/.well-known/apihubtech-alerts/your_dkey
http_code 404 the returned http code from the http challenge that took place at the specified domain
retry_at 2023-06-11 17:26:24 in case attempts_left reached to 0 then a request can be made again at the specified timestamp


1.2) Set domain

> Set the domain name where the price alerts will be directed to (more details in the table bellow)

API Method
/api/setWellKnown POST

Example Request

  curl --location 'https://price-alerts1.p.rapidapi.com/api/setWellKnown' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'domain=example.com'

Request Fields

Field Example Description
domain example.com The domain of the server you wish to receive alerts (can be set using /setWellKnown API)

Example Response

  {
        "status": "ok",
        "data": {
              "dkey": "DE27FA4B453A4119B0F28EB51E1119975E970DFB",
              "domain": example.com,
              "verifieuud": 1,
              "attempts_left": 2,
              "http_code": null,
              "retry_at": null,
              "result": false
        }
  }

Response Fields

Field Example Description
domain example.com The domain of the server you wish to receive alerts
dkey DE27FA4B453A4119B0F28EB51E1119975E970DFB The dkey where our system tried to locate and verify on your server
verified 1 Denotes if the given domain has the given dkey at https://your_domain/.well-known/apihubtech-alerts/your_dkey
http_code 200 the returned http code from the http challenge that took place at the specified domain
retry_at null in case attempts_left reached to 0 then a request can be made again at the specified timestamp
result true wether verification was success or failed



2) Notifications Section


2.1) Add Price Alert

> This api is used to generate a price alert. It is required to set a price trigger, symbol pair, direction and your callback url. The callback url is the API that will be called by our system when your price alert is triggered

API Method
/api/add POST

Example Request

  curl --location 'https://price-alerts1.p.rapidapi.com/api/add' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'symbol=EURUSD' \
  --data-urlencode 'priceTrigger=1.09661' \
  --data-urlencode 'callback=/callback/test' \
  --data-urlencode 'direction=bid'

Example Response

  {
        "status": "ok",
        "data": {
              "totalAlerts": 4,
              "id": 102
        }
  }

Response Fields

Field Example Description
totalAlerts 4 Total active price alerts
id 102 The id of the newly added price alert

> *Note: Notifications will expired after X amount of days passed, depending on your plan

Request Fields

Field Example Description
priceTrigger 1.09661 price trigger for the notification
symbol EURUSD the symbol that the price trigger will be checked (full list at https://price-alerts.apihubtech.com/symbol-list)
callback /callback/test the callback url that will be used to send the notification when it will be triggered
direction bid direction of the price trigger, possible values: [ bid , ask ]

> *Note: the domain will be taken from the wellknown stats, so if your domain is set as example.com

> Then when the notification is triggered, POST request will be made to https://example.com/callbak/test

Example of triggered Notification Send to your system

  {
        "id": "76",
        "symbol": "EURUSD",
        "direction": "bid",
        "priceTrigger": "1.09667",
        "triggered": "2023-05-10 17:26:30",
        "sendAt": "2023-05-10 17:26:31"
  }


2.1) Delete Price Alert

> Can be used to remove an active price alert by sending the id

API Method
/api/remove DELETE

Example Request

  curl --location 'https://price-alerts1.p.rapidapi.com/api/remove' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'symbol=102' 

Example Response

  {
        "status": "ok",
  }
Followers: 0
Resources:
Product Website Terms of use
API Creator:
A
APITechHub
APITechHub
Log In to Rate API
Rating: 5 - Votes: 1