{"id":14384732,"url":"https://github.com/dijs/wiki","last_synced_at":"2025-04-05T04:13:08.044Z","repository":{"id":10352408,"uuid":"12490028","full_name":"dijs/wiki","owner":"dijs","description":"Wikipedia Interface for Node.js","archived":false,"fork":false,"pushed_at":"2024-09-03T17:24:21.000Z","size":3198,"stargazers_count":316,"open_issues_count":18,"forks_count":59,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T03:07:08.021Z","etag":null,"topics":["api","article","interface","javascript","wiki","wikipedia","wrapper"],"latest_commit_sha":null,"homepage":null,"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/dijs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://www.buymeacoffee.com/2tmRKi9"}},"created_at":"2013-08-30T15:51:08.000Z","updated_at":"2025-02-10T14:57:07.000Z","dependencies_parsed_at":"2024-12-11T00:45:17.302Z","dependency_job_id":null,"html_url":"https://github.com/dijs/wiki","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fwiki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fwiki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fwiki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fwiki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dijs","download_url":"https://codeload.github.com/dijs/wiki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"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","article","interface","javascript","wiki","wikipedia","wrapper"],"created_at":"2024-08-28T18:01:37.344Z","updated_at":"2025-04-05T04:13:08.022Z","avatar_url":"https://github.com/dijs.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/2tmRKi9"],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cimg height=\"150\" src=\"img/wikijs.png\"\u003e\n\n[![NPM Version](https://img.shields.io/npm/v/wikijs.svg)](https://www.npmjs.com/package/wikijs)\n[![Build Status](https://travis-ci.org/dijs/wiki.svg)](https://travis-ci.org/dijs/wiki)\n[![Coverage Status](https://coveralls.io/repos/dijs/wiki/badge.svg)](https://coveralls.io/r/dijs/wiki)\n\n\u003ca href=\"https://www.buymeacoffee.com/2tmRKi9\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\nWikiJs is a node.js library which serves as an interface to Wikipedia (or any MediaWiki).\n\n## What can it do?\n\n- Search wiki articles\n- Fetch article content\n- Find all links/images/categories in a article page\n- Get parsed information about articles\n- Find articles by geographical location\n- and much more!\n\n## Documentation\n\n\u003chttps://dijs.github.io/wiki\u003e\n\n## Install\n\n```bash\nnpm install wikijs\n```\n\n## Usage\n\n```javascript\nimport wiki from 'wikijs';\n// const wiki = require('wikijs').default;\n\nwiki()\n\t.page('Batman')\n\t.then(page =\u003e page.info('alterEgo'))\n\t.then(console.log); // Bruce Wayne\n```\n\n## Build yourself\n\nYou can run these commands in order to build and test WikiJs:\n\n```bash\ngit clone git@github.com:dijs/wiki.git\ncd wiki\nnpm install\nnpm run build\nnpm test\n```\n\n## Usage with webpack\n\nIn order for webpack to build wikijs properly, you must add an option to\nyour webpack configuration file. [Documentation](https://webpack.js.org/configuration/externals/#externals)\n\n```json\nexternals: {\n  \"isomorphic-fetch\": \"fetch\"\n}\n```\n\n## Usage with other MediaWiki's\n\nYou can use the API options configuration:\n\n```js\nwiki({\n\tapiUrl: 'https://awoiaf.westeros.org/api.php',\n\torigin: null\n}).search('Winterfell');\n```\n\n## Usage with other languages\n\nYou just need to change the API to the proper URL. This is normally just changing the subdomain of wikipedia.\n\n```js\nwiki({ apiUrl: 'https://es.wikipedia.org/w/api.php' })\n\t.page('Cristiano Ronaldo')\n\t.then(page =\u003e page.info())\n\t.then(console.log);\n```\n\nRead more about Cross Domain Requests [here](https://www.mediawiki.org/wiki/API:Main_module)\n\n## Usage with custom headers\n\nIf you need to pass authentication headers or anything else.\n\n```js\nwiki({\n\theaders: {\n\t\tCookie: 'name=value; name2=value2; name3=value3'\n\t}\n}).search('Winterfell');\n```\n\n## Chain data requests together for more efficient applications\n\nQuery a specific page:\n\n```js\nwiki()\n\t.page('albert einstein')\n\t.then(page =\u003e\n\t\tpage\n\t\t\t.chain()\n\t\t\t.summary()\n\t\t\t.image()\n\t\t\t.links()\n\t\t\t.request()\n\t);\n```\n\nOr query many pages at once:\n\n```js\nwiki()\n\t.chain()\n\t.geosearch(52.52437, 13.41053)\n\t.summary()\n\t.image()\n\t.coordinates()\n\t.request();\n```\n\n## Parsing Wiki Infobox Data\n\nThe code Wikipedia uses for infobox data is strange and complex. So I have split the parsing code into another library. You can find it [here](https://github.com/dijs/infobox-parser).\n[![NPM Version](https://img.shields.io/npm/v/wikijs.svg)](https://www.npmjs.com/package/infobox-parser)\n\nWe not only parse out the information, but also try to transform the data into a convenient structure for data processing.\n\n## Contribute!\n\nI always welcome help. Please just stick to the lint rules and write tests with each feature/fix.\n\n## Artwork\n\nThanks to [Heather van der Dys](http://heathervanderdys.com/) for the awesome logo!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdijs%2Fwiki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdijs%2Fwiki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdijs%2Fwiki/lists"}