Skip to content

Quickstart

Get started with the Sabdasakha API in under 5 minutes.

Prerequisites

  • Basic understanding of REST APIs
  • A tool to make HTTP requests (curl, Postman, or any programming language)

Step 1: Make Your First Request

Let's look up the word "घर" (house):

curl "https://sabdasakha.com/api/v1/dictionary/word?q=घर"
import requests

response = requests.get(
    "https://sabdasakha.com/api/v1/dictionary/word",
    params={"q": "घर"}
)
data = response.json()
print(data)
const response = await fetch("https://sabdasakha.com/api/v1/dictionary/word?q=घर");
const data = await response.json();
console.log(data);

You'll receive a response like:

{
  "word": "घर",
  "part_of_speech": null,
  "split_definitions": "[...]",
  "definitions": [
    {
      "number": "१.",
      "text": "गारो लगाई छानु हालेर बनाएको मानिस बस्ने ठाउँ; गृह; आलय; भवन...",
      "part_of_speech": null
    }
  ]
}

For grouped variant entries, pass include_variants=true:

curl "https://sabdasakha.com/api/v1/dictionary/word?q=अ&include_variants=true"

For per-dictionary results from both Nepali dictionaries, pass multi_dict=true:

curl "https://sabdasakha.com/api/v1/dictionary/word?q=घर&multi_dict=true"

Step 2: Get Autocomplete Suggestions

Build a search-as-you-type experience:

curl "https://sabdasakha.com/api/v1/dictionary/suggest?q=नेपा"
response = requests.get(
    "https://sabdasakha.com/api/v1/dictionary/suggest",
    params={"q": "नेपा"}
)
suggestions = response.json()
const response = await fetch("https://sabdasakha.com/api/v1/dictionary/suggest?q=नेपा");
const suggestions = await response.json();

Response (returns up to 10 suggestions by default):

[
  "नेपाल",
  "नेपाल औद्योगिक विकास कर्पोरेसन",
  "नेपाल तारा",
  "नेपाल प्रज्ञा प्रतिष्ठान",
  "नेपाल प्रताप भास्कर"
]

Step 3: Check Spelling

Validate Nepali text for spelling errors:

curl -X POST "https://sabdasakha.com/api/v1/spellcheck/text" \
  -H "Content-Type: application/json" \
  -d '{"text": "नेपाल सुन्दर देस हो"}'
response = requests.post(
    "https://sabdasakha.com/api/v1/spellcheck/text",
    json={"text": "नेपाल सुन्दर देस हो"}
)
result = response.json()
const response = await fetch("https://sabdasakha.com/api/v1/spellcheck/text", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ text: "नेपाल सुन्दर देस हो" })
});
const result = await response.json();

Response (note: "देस" should be "देश"):

{
  "misspelled": [
    {
      "word": "देस",
      "status": "misspelled",
      "corrections": ["देश"]
    }
  ],
  "unknown": []
}

Next Steps