API Overview
The TIES Tanzania Gold Price API provides developers with access to real-time and historical gold price data for both local Tanzanian markets and international markets. Our API is designed to be simple, reliable, and easy to integrate into your applications.
Base URL: https://ties.co.tz/goldapi/
Key Features
- Real-time gold price updates for Tanzania (TZS) and international markets (USD)
- Historical price data with simple date-based filtering
- Simple token-based authentication
- JSON responses for easy integration
- Rate limiting to ensure fair usage
Authentication
All API requests require authentication using a Bearer token. You'll receive your unique API token after registering for an account.
Register for a new API account to receive your authentication token.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | String | Yes | Your desired username |
| String | Yes | Your email address | |
| password | String | Yes | Your password (min. 8 characters) |
| password_confirm | String | Yes | Password confirmation |
| company_name | String | Yes | Your company name |
| website | String | No | Your company website (optional) |
Example Request
{
"username": "mycompany",
"email": "info@mycompany.com",
"password": "securepassword123",
"password_confirm": "securepassword123",
"company_name": "My Company Ltd",
"website": "https://mycompany.com"
}
Example Response
You can get your token to profile section -
signin to get token
.
Once you have your token, include it in the Authorization header of all subsequent requests:
Authorization: Bearer your_token_here
API Endpoints
Retrieve gold price data with optional date filtering parameters.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| date | Date | No | Specific date for data (YYYY-MM-DD) |
| start_date | Date | No | Start date for historical data (YYYY-MM-DD) |
| end_date | Date | No | End date for historical data (YYYY-MM-DD) |
Usage Notes
- Use either
dateparameter ORstart_dateandend_dateparameters, not both - If no date parameters are provided, returns all available data
- Returns all available price types, currencies, and units for the specified date(s)
Example Requests
# Get all prices
GET /api/prices/
# Get prices for a specific date
GET /api/prices/?date=2024-01-15
# Get prices within a date range
GET /api/prices/?start_date=2024-01-01&end_date=2024-01-31
Example Response
Retrieve the latest gold price data with specific parameters.
Example Request
GET /api/prices/latest/
Example Response
Retrieve your API user profile information.
Example Response
Quick Start Guide
Get up and running with our API in just a few simple steps.
Register for an API Account
Send a POST request to the registration endpoint to create your account and receive your API token.
POST /api/register/
Store Your Token Securely
Save the token you received in the registration response. You'll need it for all API requests.
Get Latest Price
Make a simple request to get the latest gold price with your preferred parameters.
GET /api/prices/latest/?type=local¤cy=TZS&unit=gram
Get Historical Data
Retrieve historical data using simple date filters.
GET /api/prices/?start_date=2024-01-01&end_date=2024-01-31
Support & Contact
If you need help with our API or have any questions, please don't hesitate to contact our support team.
Technical Support
Email: it@ties.co.tz
Response Time: Within 24 hours on business days
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or date format |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Please contact support |