API function to obtain usage by stream?


#1

I’ve reviewed the doc for the USAGE api resource in the REST interface. I can’t see a parameter for stream hash. Can I obtain the usage of an individual stream over a defined time period via the API?


#2

No, but when you hit the /usage API endpoint, your usage stats are broken down on a stream-by-stream basis:

 

"streams": {
    "3867df488c6108a63ba5d6": {
        "licenses": {
            "interaction": 29,
            "salience.sentiment": 29,
            "twitter": 29
        },
        "seconds": 300
    },
    "43abf8312f6571f27cc723": {
        "licenses": {
            "interaction": 1217,
            "salience.sentiment": 1217,
            "twitter": 1217
        },
        "seconds": 3600
    }
}

#3

Ok, thanks. I didn’t realise that they are broken down that way.

that’s probably enough for my needs - I’ll experiment some more and see.