| # Sema Translation API - Curl Commands | |
| ```bash | |
| # β Basic Health Check | |
| curl https://sematech-sema-api.hf.space/health | |
| ``` | |
| ```bash | |
| # β Simple Translation | |
| curl -X POST "https://sematech-sema-api.hf.space/translate" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"text": "Habari ya asubuhi", "target_language": "eng_Latn"}' | |
| ``` | |
| ```bash | |
| # β Get All Supported Languages | |
| curl https://sematech-sema-api.hf.space/languages | |
| ``` | |
| ```bash | |
| # β Search for a Specific Language (e.g., Swahili) | |
| curl "https://sematech-sema-api.hf.space/languages/search?q=Swahili" | |
| ``` | |
| ```bash | |
| # β Basic Translation with Auto-Detection (relative path) | |
| curl -X POST "/translate" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"text": "Habari ya asubuhi", "target_language": "eng_Latn"}' | |
| ``` | |
| ```bash | |
| # β Translation with Specified Source Language | |
| curl -X POST "/translate" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"text": "Hello world", "source_language": "eng_Latn", "target_language": "swh_Latn"}' | |
| ``` | |
| --- | |