python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

Create examples and verify implementation of AlchemyData News

Open jsstylos opened this issue 11 years ago • 3 comments

Master now contains an implementation for AlchemyData News, but this needs some testing and examples.

We should start by showing examples of basic usage in /examples/alchemy_data_news_v1.py, and verifying that the SDK works correctly for these examples. There are examples to try at http://querybuilder.alchemyapi.com/builder (under the Examples tab). A high-quota api key should be used, since these can use a lot of transactions.

jsstylos avatar Nov 23 '15 16:11 jsstylos

Creating more simple, and comple examples...

fmerici avatar Dec 10 '15 18:12 fmerici

I can not work out have to do filters or how I need to create the string for the Query_fields parameter.

I'm trying to return these results.

https://access.alchemyapi.com/calls/data/GetNews?apikey=YOUR_API_KEY_HERE&return=enriched.url.title,enriched.url.url,enriched.url.author,enriched.url.publicationDate&start=1453334400&end=1454022000&q.enriched.url.enrichedTitle.entities.entity=|text=IBM,type=company|&count=25&outputMode=json

masto182 avatar Jan 28 '16 12:01 masto182

@masto182: To return results like that you do a call like: alchemy_data_news.get_news_documents(start='1453334400', end='1454022000', return_fields=['enriched.url.title', 'enriched.url.url', 'enriched.url.author', 'enriched.url.publicationDate'], query_fields={'q.enriched.url.enrichedTitle.entities.entity': '|text=IBM,type=company|'}).

The one field I'm not sure of is the count query parameter -- I don't see it documented at https://alchemyapi.readme.io/v1.0/docs/rest-api-documentation. Did you mean maxResults? (If so, this would be max_results=25 in the Python SDK.)

jsstylos avatar Jan 28 '16 15:01 jsstylos