Vietnamese HS Code Classification API - Free, open-source REST API for searching Vietnamese Harmonized System (HS) Code Explanatory Notes.
- π Bilingual Search - Search in Vietnamese or English across comprehensive Explanatory Notes
- π Comprehensive Data - 97 chapters with EN (Explanatory Notes) and SEN (Supplementary Explanatory Notes)
- π Fast & Free - Completely free with generous rate limits (1000/hour per IP)
- π Open Source - MIT licensed, host it yourself or use our free hosted service
- π€ AI-Ready - Perfect for ChatGPT Custom GPTs, Claude integrations, and other AI assistants
- β‘ High Performance - In-memory caching, <500ms response times
# Search for HS codes
curl -X POST https://api.tracuuhs.com/v1/search \
-H "Content-Type: application/json" \
-d '{"keyword": "milk", "language": "en", "maxResults": 5}'# Clone the repository
git clone https://github.com/quyphong91/hstc-api.git
cd hstc-api
# Install dependencies
npm install
# Start development server
npm run dev
# Production build
npm run build
npm startThe API will be available at http://localhost:3000
Search through Explanatory Notes and Supplementary Explanatory Notes.
Request:
{
"keyword": "plastic bottles",
"language": "en",
"matchType": "tokens",
"material": "plastic",
"functionFeature": "water storage",
"maxResults": 20
}Response:
{
"success": true,
"data": {
"matches": [
{
"hsCode": "3923",
"source": "en",
"snippet": "Carboys, bottles, flasks and similar articles...",
"chapterNumber": 39
}
],
"totalMatches": 15,
"query": { "keyword": "plastic bottles", "filters": {} }
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-02-14T10:30:00Z",
"processingTime": 27,
"attribution": {
"poweredBy": "tracuuhs.com",
"documentation": "https://tracuuhs.com/api/docs",
"source": "open-source",
"github": "https://github.com/quyphong91/hstc-api"
}
}
}List all available chapters with metadata.
Response:
{
"success": true,
"data": {
"chapters": [
{
"chapterNumber": 1,
"title": {
"vi": "Δα»ng vαΊt sα»ng",
"en": "Live animals"
},
"hasEN": true,
"hasSEN": true
}
]
}
}Get detailed notes for a specific chapter.
Query Parameters:
source(optional):en|sen|both(default:both)language(optional):vi|en(default:vi)
Example:
curl "https://api.tracuuhs.com/v1/chapters/4?source=both&language=vi"Get detailed notes for a specific 4-digit HS heading.
Example:
curl "https://api.tracuuhs.com/v1/headings/0401?language=en"Health check endpoint.
Response:
{
"status": "ok",
"version": "1.0.0",
"timestamp": "2026-02-14T10:30:00Z",
"dataVersion": "2024",
"uptime": 3600.5
}API keys are optional and used for higher rate limits and usage analytics (not for billing).
curl -X POST https://api.tracuuhs.com/v1/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{"keyword": "coffee"}'Rate Limits:
- Without API key: 1000 requests/hour per IP
- With API key: 5000 requests/hour
Get a free API key at: https://tracuuhs.com/developer
Use our pre-built Custom GPT: HSTC - Vietnamese HS Code Expert
Or create your own using our OpenAPI schema in docs/API.md.
Coming soon! We're working on an MCP server wrapper for Claude Desktop users.
// Example: Node.js / JavaScript
const response = await fetch('https://api.tracuuhs.com/v1/search', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your-api-key'
},
body: JSON.stringify({
keyword: 'mΓ‘y tΓnh xΓ‘ch tay',
language: 'vi',
maxResults: 10
})
});
const data = await response.json();
console.log(data.data.matches);# Build image
docker build -t hstc-api .
# Run container
docker run -p 3000:3000 -e PORT=3000 hstc-apiSee docs/DEPLOYMENT.md for detailed deployment guides (Vercel, Railway, DigitalOcean, etc.).
- API Reference - Complete endpoint documentation with examples
- Deployment Guide - Self-hosting instructions
- Website Documentation - Interactive API explorer
# Install dependencies
npm install
# Run development server with hot reload
npm run dev
# Build for production
npm run build
# Run production server
npm start
# Lint code
npm run lintProject Structure:
hstc-api/
βββ src/
β βββ data/ # JSON data files (EN/SEN notes, chapters)
β βββ routes/ # API route handlers
β βββ middleware/ # Auth, rate limiting, attribution
β βββ utils/ # Search logic, data loading, types
β βββ server.ts # Express app setup
β βββ index.ts # Server entry point
βββ scripts/
β βββ convert-data.ts # Data conversion utilities
βββ docs/ # Documentation
βββ package.json
We welcome contributions! Here's how you can help:
- Report Bugs - Open an issue on GitHub
- Suggest Features - Share your ideas via GitHub issues
- Submit PRs - Fix bugs, improve docs, add features
- Improve Data - Submit corrections to EN/SEN notes
- Share Use Cases - Show us what you built with the API!
This project is licensed under the MIT License - see the LICENSE file for details.
- Data Source: Vietnamese Customs General Department
- Powered by: tracuuhs.com
- Maintained by: @quyphong91
- Website: https://tracuuhs.com
- API Documentation: https://tracuuhs.com/api/docs
- Custom GPT: https://tracuuhs.com/custom-gpt
- Developer Portal: https://tracuuhs.com/developer
- GitHub: https://github.com/quyphong91/hstc-api
- GitHub Issues: Report bugs or request features
- Documentation: https://tracuuhs.com/api/docs
- Community: Join our discussions on GitHub
Made with β€οΈ for the Vietnamese trade community
Free and open source forever. Self-host or use our hosted service at api.tracuuhs.com