{"id":16227657,"url":"https://github.com/el3um4s/denowiki","last_synced_at":"2026-04-30T15:31:44.471Z","repository":{"id":57675318,"uuid":"278941700","full_name":"el3um4s/DenoWiki","owner":"el3um4s","description":"A simple API for DenoJS to query Wikipedia and parse the results.","archived":false,"fork":false,"pushed_at":"2021-02-11T15:32:52.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T09:17:51.561Z","etag":null,"topics":["deno","wikiparse-query","wikiparser","wikipedia-api","wikisearch-query"],"latest_commit_sha":null,"homepage":"https://deno.land/x/denowiki","language":"TypeScript","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/el3um4s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["el3um4s"],"patreon":"el3um4s","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/el3um4s"]}},"created_at":"2020-07-11T21:05:54.000Z","updated_at":"2021-02-11T15:26:15.000Z","dependencies_parsed_at":"2022-09-05T22:00:34.848Z","dependency_job_id":null,"html_url":"https://github.com/el3um4s/DenoWiki","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2FDenoWiki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2FDenoWiki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2FDenoWiki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el3um4s%2FDenoWiki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/el3um4s","download_url":"https://codeload.github.com/el3um4s/DenoWiki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247777958,"owners_count":20994388,"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":["deno","wikiparse-query","wikiparser","wikipedia-api","wikisearch-query"],"created_at":"2024-10-10T12:53:27.596Z","updated_at":"2026-04-30T15:31:44.293Z","avatar_url":"https://github.com/el3um4s.png","language":"TypeScript","funding_links":["https://github.com/sponsors/el3um4s","https://patreon.com/el3um4s","https://www.paypal.me/el3um4s"],"categories":[],"sub_categories":[],"readme":"# DenoWiki\n\n[![GitHub license](https://img.shields.io/github/license/el3um4s/DenoWiki.svg)](https://github.com/el3um4s/DenoWiki/blob/master/LICENSE)\n[![GitHub tag](https://img.shields.io/github/tag/el3um4s/DenoWiki.svg)](https://GitHub.com/el3um4s/DenoWiki/tags/)\n[![HitCount](http://hits.dwyl.com/el3um4s/DenoWiki.svg)](http://hits.dwyl.com/el3um4s/DenoWiki)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/raw.githubusercontent.com/el3um4s/DenoWiki/master/mod.ts)\n[![deno.land](https://img.shields.io/badge/deno.land-1.7.2-blue)](https://deno.land/x/denowiki)\n\nA simple API for DenoJS to query Wikipedia and parse the results.\n\n### Usage\n\n```typescript\nimport * as wiki from \"https://deno.land/x/denowiki/mod.ts\";\n\nconst wikiSearchResult: wiki.WikiSearch_Query = await wiki.wikiSearch(\n  { language: \"en\", srsearch: \"doctor who\", srlimit: 15 },\n);\nconst pageID: number = wiki.getPageId(wikiSearchResult);\nconst wikiPage: wiki.WikiParse_Query = await wiki.wikiParse(\n    { pageid: pageID, language: \"en\", prop: \"wikitext|text\" },\n  );\nconst text: string = wiki.getWikiText(wikiPage);\n\nconsole.log(text);\n```\n\nThis module use the Wikipedia [API:Search](https://www.mediawiki.org/wiki/API:Search) and [API:Parsing wikitext](https://www.mediawiki.org/wiki/API:Parsing_wikitext).\n\nRequire `deno` (obviously) and `--allow-net` permission.\n\nThere are 2 demos available. The first demo queries Wikipedia and print the first result\n\n```\ndeno run --allow-net .\\demo_cmd.ts milan en false\ndeno run --allow-net .\\demo_cmd.ts \"doctor who\" en true\n```\n\nThe second demo searches a list of people and return how many exist in Wikipedia\n\n```\ndeno run --allow-net .\\demo_array.ts\n```\n\nYou can run the demos directly from the repository with the commands:\n\n```\ndeno run --allow-net https://deno.land/x/denowiki/demo_cmd.ts milan en false\ndeno run --allow-net https://deno.land/x/denowiki/demo_cmd.ts \"doctor who\" en true\ndeno run --allow-net https://raw.githubusercontent.com/el3um4s/DenoWiki/master/demo_array.ts\n```\n\n### API: wikiSearch\n\n* **function wikiSearch(options): Promise\u003cWikiSearch_Query\u003e** : _Search for a term on Wikipedia and return the corresponding pages (max 500)_\n* **function getPageId(wikiJSON: WikiSearch_Query, position): number** : _Returns the pageID number of Wikipedia referring to the searched term_\n* **function getSearchTitle(wikiJSON: WikiSearch_Query, position): string** : _Returns the Title of Wikipedia referring to the searched term_\n* **function getNumberResults(wikiJSON: WikiSearch_Query): number** : _Returns the total number of matches found for the search term. May be bigger than the results returned by wikiSearch(options)_\n* **function getNumberResultsListed(wikiJSON: WikiSearch_Query): number** : _Returns the number of results found by wikiSearch(options)_\n* **function getSuggestion(wikiJSON: WikiSearch_Query): string** : _Returns the suggested term related to the searched term_\n* **function hasResult(wikiJSON: WikiSearch_Query): boolean** : _TRUE if there are results for the searched term_\n* **function hasSuggestion(wikiJSON: WikiSearch_Query): boolean** : _TRUE if there are suggested searches related to the searched term_\n* **function wikiSearchQuery(options): string** : _Returns the url address to be used as the source to obtain the information_\n\n### API: wikiParse\n\n* **function wikiParse(options): Promise\u003cWikiParse_Query\u003e** : _Returns the contents of a Wikipedia page_\n* **function getWikiText(wikiPage: WikiParse_Query): string** : _Returns the original wikitext._\n* **function getHTMLText(wikiPage: WikiParse_Query): string** : _Returns the parsed text of the wikitext._\n* **function getPageTitle(wikiPage: WikiParse_Query): string** : _Returns the Title of Wikipedia referring to the page searched_\n* **function wikiParseQuery(options): string**: _Returns the url address to be used as the source to obtain the information_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel3um4s%2Fdenowiki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fel3um4s%2Fdenowiki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel3um4s%2Fdenowiki/lists"}