ibm-cloudibm-watsonalchemyapi

Bluemix news api transaction limit exceeded


I have added the Alchemy API service to my Bluemix dashboard and can use the credentials to call the API. I have configured the service to use the "Ecosystem" plan.

My App calls the news API fine for the first few calls and then I get API transaction limit exceeded. Is there a limit for calls on the Ecosystem plan?

Thanks Brendan


Solution

  • Alchemy API is tricky. You're probably reaching the 1000 events a day.

    First, you need to understand how the events are count.

    Here is an example:

    To calculate how many transaction credits a query will cost, multiply historical access and targeting.
    
    Historical Access - each hour of historical access costs 1 transaction credit
    Targeting - each query parameter costs 1 transaction credit
    
    Example: Give me news about the company "IBM" from the past 3 days.
    
        Historical access: 3 days = 72 transaction credits
        Targeting: 1 query parameter = 1 transaction credit
        Query cost: 72 transaction credits
    

    see https://www.alchemyapi.com/alchemydata-news-sales for more explanation

    second, you need to check how many credits you've already used. Use this API for that

    http://access.alchemyapi.com/calls/info/GetAPIKeyInfo?apikey=YOUR_API_KEY

    finally, cache everything you retrieve from AlchemyAPI (bluemix has several options for that)