import pywikibot
from pywikibot.data import api

searchfor='haswbstatement:P31=Q13442814 -artikel'

def getItems(site, itemtitle):
     params = { 'action' :'wbsearchentities' , 'format' : 'json' , 'language' : 'en', 'type' : 'item', 'search': itemtitle}
     request = api.Request(site=site,parameters=params)
     return request.submit()

def search(search_for):
    site = pywikibot.Site("nl", "wikipedia")
    repo = site.data_repository()
    searchresult = getItems(site, search_for)
    result=[]
    if ('search' in searchresult):
     for item in searchresult['search']:
        itemID=item['id']
        wd=pywikibot.ItemPage(repo,item['id'])
        wd.get(get_redirect=True)
        #result.append(wd.title())
        yield(wd)

print('Start')        
for x in search(searchfor):
    desc=''
    if 'nl' in x.descriptions:
      desc=x.descriptions['nl']
    print(f'{x.title()}={desc}')
print('Klaar')    
Start
WARNING: API error unknown_action: Unrecognized value for parameter "action": wbsearchentities.
---------------------------------------------------------------------------
APIError                                  Traceback (most recent call last)
<ipython-input-8-2c21556030f9> in <module>
     23 
     24 print('Start')
---> 25 for x in search(searchfor):
     26     desc=''
     27     if 'nl' in x.descriptions:

<ipython-input-8-2c21556030f9> in search(search_for)
     12     site = pywikibot.Site("nl", "wikipedia")
     13     repo = site.data_repository()
---> 14     searchresult = getItems(site, search_for)
     15     result=[]
     16     if ('search' in searchresult):

<ipython-input-8-2c21556030f9> in getItems(site, itemtitle)
      7      params = { 'action' :'wbsearchentities' , 'format' : 'json' , 'language' : 'en', 'type' : 'item', 'search': itemtitle}
      8      request = api.Request(site=site,parameters=params)
----> 9      return request.submit()
     10 
     11 def search(search_for):

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2077                               % result)
   2078 
-> 2079                 raise APIError(**result['error'])
   2080             except TypeError:
   2081                 raise RuntimeError(result)

APIError: unknown_action: Unrecognized value for parameter "action": wbsearchentities. [help:See https://nl.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes.]