Trend Endpoint: search for entity types

Julian_Kartte
Julian_Kartte Posts: 1 New Member
edited February 14 in Quantexa News Intelligence

Have you already searched the Community for similar issues? The answer may already be waiting for you.

To help you get an answer as quickly as possible, fill out the following template (please do not delete, or miss out any fields - this will delay the resolution time): 

Description: Using trends-endpoint to search for entities of type "Company"

Support type: expected behavior

Version:

Components: Quantexa News Intelligence, News API

Debugging:  e.g. copies of logs, Developer Tools errors, links to Documentation and Community posts consulted

Code (please insert into the code block below):

params = {    'published_at': '[NOW-14DAYS TO NOW]',    'language': '(de)',    'categories': '{{taxonomy:aylien AND id:(ay.lifesoc.esg) AND score:>=0.65}}',    'entities': '{{types:("Company")}}', # this does not work    'field': 'entities.surface_forms.text',}
response = requests.get('https://api.aylien.com/v6/news/trends', params=params, headers=headers)
print(response)
print(response.content)
# b'{"errors":[{"id":"trends_params_entities","links":{"about":"https://docs.aylien.com/newsapi/#error-codes-amp-responses","docs":"https://docs.aylien.com/newsapi"},"type":"http://httpstatus.es/422","title":"Unsupported parameter in AQL query.","status":422,"code":"KB422","detail":"Unsupported field: entities.types"}]}'

Is something like 'entities': '{{types:("Company")}}' possible?

Best Answer

  • Saba_Soltan
    Saba_Soltan Posts: 333 QUANTEXA TEAM
    Answer Accepted ✓

    Hey @Julian_Kartte

    Welcome to the Quantexa Community! :)

    it's possible, but please change your syntax to the following:

    params = {    
         'published_at': '[NOW-14DAYS TO NOW]',
        'language': '(de)',   
         'categories': '{{taxonomy:aylien AND id:(ay.lifesoc.esg) AND score:>=0.65}}',  
         'entities': '{{type:("Company")}}'
           }
    

Comments

  • Saba_Soltan
    Saba_Soltan Posts: 333 QUANTEXA TEAM

    Also, your question was posted in Quantexa Platform Support, but it actually belongs in Quantexa News Intelligence.

    I’ll go ahead and move it to the right category! :)