Gold Price API (version 2)¶
This module allows users to get gold data
Quick reference¶
Resource |
Operation |
Description |
---|---|---|
|
Get SJC Gold Price |
|
Post SJC Gold Price |
||
|
Get DOJI Gold Price |
|
Post DOJI Gold Price |
||
|
Get PNJ Gold Price |
|
Post PNJ Gold Price |
Usage permission¶
To use this API, please self-request api_key
at https://vapi.vnappmob.com/api/request_api_key?scope=gold
The api_key
will be expired by default after 15 days
Details¶
-
GET
/api/v2/gold/doji
¶ This function allows users to get the latest DOJI Gold price
Request:
GET /api/v2/gold/doji HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "results": [ { "buy_hcm": 42550000.00, "sell_hcm": 42550000.00 }... ] }
- Query Parameters
date_from – Set date from query
date_to – Set date to query
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=0>
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – OK
400 Bad Request – Error
403 Forbidden – Fail on authorization
-
POST
/api/v2/gold/doji
¶ This function allows data manager to push newest data
Request:
POST /api/v2/gold/doji HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 201 Created Vary: Accept
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=1>
Content-Type – application/json
- Request JSON Object
buy_hcm (float) – buy_hcm
sell_hcm (float) – sell_hcm
buy_hn (float) – buy_hn
sell_hn (float) – sell_hn
- Status Codes
201 Created – Successful
400 Bad Request – Error
403 Forbidden – Fail on authorization
-
GET
/api/v2/gold/sjc
¶ This function allows users to get the latest SJC Gold price
Request:
GET /api/v2/gold/sjc HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "results": [ { "buy_1l": 42550000.00, "sell_1l": 42550000.00 }... ] }
- Query Parameters
date_from – Set date from query
date_to – Set date to query
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=0>
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – OK
400 Bad Request – Error
403 Forbidden – Fail on authorization
-
POST
/api/v2/gold/sjc
¶ This function allows data manager to push newest data
Request:
POST /api/v2/gold/sjc HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 201 Created Vary: Accept
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=1>
Content-Type – application/json
- Request JSON Object
buy_1l (float) – buy_1l
sell_1l (float) – sell_1l
buy_1c (float) – buy_1c
sell_1c (float) – sell_1c
buy_nhan1c (float) – buy_nhan1c
sell_nhan1c (float) – sell_nhan1c
buy_trangsuc49 (float) – buy_trangsuc49
sell_trangsuc49 (float) – sell_trangsuc49
- Status Codes
201 Created – Successful
400 Bad Request – Error
403 Forbidden – Fail on authorization
-
GET
/api/v2/gold/pnj
¶ This function allows users to get the latest PNJ Gold price
Request:
GET /api/v2/gold/pnj HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "results": [ { "buy_hcm": 42550000.00, "sell_hcm": 42550000.00 }... ] }
- Query Parameters
date_from – Set date from query
date_to – Set date to query
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=0>
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – OK
400 Bad Request – Error
403 Forbidden – Fail on authorization
-
POST
/api/v2/gold/pnj
¶ This function allows data manager to push newest data
Request:
POST /api/v2/gold/pnj HTTP/1.1 Host: https://vapi.vnappmob.com Accept: application/json
Response:
HTTP/1.1 201 Created Vary: Accept
- Request Headers
Authorization – Bearer <api_key|scope=gold|permission=1>
Content-Type – application/json
- Request JSON Object
buy_hcm (float) – buy_hcm
sell_hcm (float) – sell_hcm
buy_hn (float) – buy_hn
sell_hn (float) – sell_hn
- Status Codes
201 Created – Successful
400 Bad Request – Error
403 Forbidden – Fail on authorization