An open-source Python library for accessing Singapore bullion retailers API
Designed for retail investors and businesses, this package streamlines the process of integrating with the bullion marketplace by abstracting complex API calls and providing intuitive functions to manage investments in gold, silver, and other precious metals.
BullionStar Singapore https://www.bullionstar.com/developer/docs/api/
# import the module
from bullion import BullionStarBullionStar Object
| locationId | Country |
|---|---|
| 1 | Singapore |
| 3 | New Zealand |
# Creates a http session
bullionstar_client = BullionStar(cuurency='SGD', locationId=1)Authentication API
- Initialize Authentication
authToken, salt = bullionstar_client.initialize('example@example.com')- Perform Authentication
hashedPassword = BullionStar.hashPassword(password)
encryptedPassword = BullionStar.encryptPassword(salt, hashedPassword)
authenticate_response = bullionstar_client.authenticate(authToken, encryptedPassword)- Perform Two-factor Authentication
- Resend Two-factor Authentication Code
- Invalidate Access Token
invalidate_response = bullionstar_client.invalidate()Shopping Cart API
- Refresh Shopping Cart
- Add to Shopping Cart
| ID | Item |
|---|---|
| 480 | 1 Gram of Gold - Bullion Savings Program (BSP) |
| 481 | 1 Gram of Silver - Bullion Savings Program (BSP) |
IMPORTANT!!! Product ID are different across location
cart_response = bullionstar_client.add_to_shopping_cart(productId=481, quantity=32)- Update Shopping Cart (unstable)
- Remove from Shopping Cart (unstable)
- Load All Shopping Carts
Buy Checkout API (in-development)
- Initialize Order
- Update Order
- Confirm Order
- Confirm Order and Create Account
Silver Bullion Singapore Stargrams (development on hold)
# import the module
from bullion import StarGramsStarGrams Object
# Creates a http session
stargrams_client = StarGrams()- Login
login_response = stargrams_client.login('example@example.com', 'some_password')- 2FA
- User
Silver Bullion Singapore (development on hold)
- Login function