code: def get_wd_search_results(search_string='', mediawiki_api_url='https://www.wikidata.org/w/api.php',
                                user_agent=config['USER_AGENT_DEFAULT'],
                                max_results=500, language='en'):
          
          params = {
              'action': 'wbsearchentities',
              'language': language,
              'search': search_string,
              'format': 'json',
              'limit': 50
          }
  
          headers = {
              'User-Agent': user_agent
          }
  
          cont_count = 1
          id_list = []
          id_labels = []
  
          while cont_count > 0:
              params.update({'continue': 0 if cont_count == 1 else cont_count})
  
              reply = requests.get(mediawiki_api_url, params=params, headers=headers)
              reply.raise_for_status()
              search_results = reply.json()
  
              if search_results['success'] != 1:
                  raise WDSearchError('WD search failed')
              else:
                  for i in search_results['search']:
                      id_list.append(i['id'])
                      id_labels.append(i['label'])
  
              if 'search-continue' not in search_results:
                  cont_count = 0
              else:
                  cont_count = search_results['search-continue']
  
              if cont_count > max_results:
                  break
  
          return id_list
docs: Performs a search in WD for a certain WD search string
          :param search_string: a string which should be searched for in WD
          :type search_string: str
          :param mediawiki_api_url: Specify the mediawiki_api_url.
          :type mediawiki_api_url: str
          :param user_agent: The user agent string transmitted in the http header
          :type user_agent: str
          :param max_results: The maximum number of search results returned. Default 500
          :type max_results: int
          :param language: The language in which to perform the search. Default 'en'
          :type language: str
          :return: returns a list of QIDs found in the search and a list of labels complementary to the QIDs