dijs / wiki

Wikipedia Interface for Node.js
MIT License
315 stars 61 forks source link

Query support? #172

Open dannysmc95 opened 1 year ago

dannysmc95 commented 1 year ago

Hello,

I am trying to do a query like so: https://starcitizen.tools/api.php?action=query&format=json&prop=&list=categorymembers&cmtitle=Category%3AShips&cmprop=ids%7Ctitle&cmnamespace=0&cmlimit=500

But I can't see a way to do this via your API, anything I am missing? Or not something that is implemented?

Thanks,

dijs commented 1 year ago

This is absolutely implemented.

Here you are:

wiki({ apiUrl: 'https://starcitizen.tools/api.php' })
  .api({
  format: 'json',
  prop: '',
  list: 'categorymembers',
  cmtitle: 'Category:Ships',
  cmprop: 'ids|title',
  cmnamespace: '0',
  cmlimit: '500'
})
dannysmc95 commented 1 year ago

Hi @dijs

Unfortunately api does not exist in that apparently, maybe set as private?

image

Thanks,

dijs commented 1 year ago

It looks like it got left out of the type file: https://github.com/dijs/wiki/blob/master/index.d.ts Could you fix that? @dannysmc95