{"id":20006817,"url":"https://github.com/parsakafi/vajehyab","last_synced_at":"2025-06-28T11:34:09.360Z","repository":{"id":57390059,"uuid":"128821660","full_name":"parsakafi/vajehyab","owner":"parsakafi","description":"VajehYab API client written in JS","archived":false,"fork":false,"pushed_at":"2018-04-10T10:24:39.000Z","size":8,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T10:05:22.408Z","etag":null,"topics":["api","expressjs","javascript","js","json","json-api","nodejs","request","vajehyab"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parsakafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-09T19:13:20.000Z","updated_at":"2024-08-04T10:48:30.000Z","dependencies_parsed_at":"2022-09-15T05:00:38.453Z","dependency_job_id":null,"html_url":"https://github.com/parsakafi/vajehyab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fvajehyab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fvajehyab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fvajehyab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fvajehyab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parsakafi","download_url":"https://codeload.github.com/parsakafi/vajehyab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252382699,"owners_count":21739205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","expressjs","javascript","js","json","json-api","nodejs","request","vajehyab"],"created_at":"2024-11-13T06:13:46.341Z","updated_at":"2025-05-04T18:33:35.770Z","avatar_url":"https://github.com/parsakafi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VajehYab \nVajehYab API client written in JS\n\n## Install\n```bash\nnpm install vajehyab --save\n```\nUsage   \nYou can get VajehYab API token from [Developer Page](http://api.vajehyab.com/i/developer) ([API Documentation](http://api.vajehyab.com/api/documentation))\n```js\nconst VajehYab = require('vajehyab');\nconst vajehyabToken = process.env.vajehyabToken; // VajehYab API Token\nconst client = new VajehYab(vajehyabToken, {ip, product, prettyprint, debug});\n```\n- `params`\n  - `token`: VajehYab API token\n  - `ip`: The User IP. Default is ` `, (Optional)\n  - `product`: The product name. Default is ` `, (Optional)\n  - `prettyprint`: The response pretty printed. Default is `true`, (Optional)\n  - `debug`: The debug mode. Default is `false`, (Optional)\n  \nExample\n```js\nconst VajehYab = require('vajehyab');\nconst vajehyabToken = process.env.vajehyabToken; // VajehYab API Token\nconst client = new VajehYab(vajehyabToken, {ip:'222.2.65.3', product: 'Test', prettyprint: true, debug: false});\n```\n\nAll method using `async`/`await` in Node \u003e= 8\n\n### Search   \n\nThis method is used to search for a term or phrase. The meaning of the word is limited and insert \"...\" at the end.   \n```js\n(async () =\u003e {\n    try {\n        const search = await client.search(q, {type, start, rows, filter});\n        console.log(search);\n    } catch (e) {\n        console.log(e);\n    }\n})();\n```\n- `params`\n  - `q`: The search word\n  - `type`: The search type, You can set `exact`,`ava`,`like`,`text`. Default is `exact`, (Optional)\n  - `start`: The start row. Default is `0`, (Optional)\n  - `rows`: The response rows. Default is `10`, (Optional)\n  - `filter`: The Database names with priority. Default is `dehkhoda, moein, amid, motaradef, farhangestan, sareh, ganjvajeh, wiki, slang, quran, name, thesis, isfahani, bakhtiari, tehrani, dezfuli, gonabadi, mazani, en2fa, ar2fa, fa2en, fa2ar`, (Optional)\n  \nExample\n```js\n(async () =\u003e {\n    try {\n        const search = await client.search('رایانه');\n        console.log(search);\n    } catch (e) {\n        console.log(e);\n    }\n})();\n```\n```js\nconst search = await client.search('رایانه', {type: 'like', start: 0, rows: 10, filter: 'dehkhoda,moein,amid'});\nconsole.log(search);\n```\n### Word Detail:\n\nThis method is used to get the full meaning of a word. It is possible with HTML tags.\n```js\nconst word = await client.word(title, db, num);\n```\n- `params`\n  - `title`: The word from search method response\n  - `db`: The Database name from search method response\n  - `num`: The `num` parameter from search method response\n  \nExample\n```js\nconst word = await client.word('ایران', 'dehkhoda', 1);\nconsole.log(word);\n```\n\n### Suggest Word:\nThe proposed list is used for autocomplete.\n```js\nconst suggest = await client.suggest(q);\n```\n- `params`\n  - `q`: The search word\n  \nExample\n```js\nconst suggest = await client.suggest('ایران');\nconsole.log(suggest);\n```\n\n### Express Example\n```js\nconst VajehYab = require('vajehyab');\nconst vajehyabToken = process.env.vajehyabToken; // VajehYab API Token\nconst client = new VajehYab(vajehyabToken, {ip:'222.2.65.3', product: 'Test', prettyprint: true, debug: false});\nconst express = require('express');\nconst app = express();\n\napp.get('/', (req, res) =\u003e {\n    (async () =\u003e {\n        try {\n            const search = await client.search('رایانه');\n            res.send(search);\n        } catch (e) {\n            res.send(e);\n        }\n    })();\n}).listen(3000);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparsakafi%2Fvajehyab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparsakafi%2Fvajehyab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparsakafi%2Fvajehyab/lists"}