What programming languages do you officially support?

At the moment we have officially supported clients for JavaScript, Python, Java and Objective-C and an Android Starter that uses Java. You can also find some other community-built ones like PHP on our API reference page here.



What about Swift and C#? I code in one of those!

Totally feel ya here. We don't have any officially supported clients for these yet but we should in the very near future. For Swift, you can check out our demo package here.



Can I return results from two or more models at once via the API?

Yep! We just released some new functionality called Workflows that allows you to call up to 5 models at once (public, custom or both). Check it out!



Do you accept base64 encoded data?

We do! Many of our v2 clients accept base64 encoded data for local files, though it isn’t always needed. 

For example, JavaScript requires it for local files:

app.models.predict(Clarifai.GENERAL_MODEL, {base64: "G7p3m95uAl..."}).then(    
    function(response) {      
    },    
    function(err) {          
    }  
);

Whereas Python gives you three options:

predict_by_base64(base64_bytes, lang=None)

predict_by_bytes(raw_bytes, lang=None)

predict_by_filename(filename, lang=None)



How do you return results back?

We will always return results in JSON format to you, no matter what client you're using.



Is there a way to set my token so that it doesn't expire?

Good news! Our new API Keys never expire so you don't need to worry about that! Woohoo!

If you're using our older Token functionality you will want to switch to Keys as soon as possible. We're keeping them around for now but they will be deprecated at some point.



Do you have a Status Dashboard that I can check to see if everything is running smooth as butter?

We sure do! You can find this at http://status.clarifai.com and we'll try and keep that updated as much as possible.



I am getting throttled by the API. What's up with that?

Bummer. There are several things that can cause this:

  • You're on v1 and you hit an hourly or monthly limit
  • You're on v2 and you hit a Free Tier limit (5,000 operations, 10,000 inputs, 10 concepts)
  • You're an Enterprise User and you hit your pre-defined limit
  • You're making more than 10 calls per second
  • You never verified your email address with us and are hitting the 100 operation "Unverified Email Plan" limit

The first 3 scenarios are common ones, and the fourth means you're simply making too many calls at once. In the latter case, batching your requests in chunks of 32 would likely solve the issue, and it would also put less load on our servers :-)

If a throttle ever seems weird or incorrect feel free to reach out to us.



Can I send requests from multiple threads?

Our API has been designed to handle highly concurrent requests so you can totally do this - to an extent. Just note that batching is much faster if you're able to do so.



It's taking a really long time to get a response from the API. Why is that?

Well that's not good! Typically we take only 300-500 milliseconds to return an image response to you, so if you're seeing really long response times then something is up. 

Possible causes of long response times include:

  • Really large image files in the 4+ MB range
  • Really large video files in the 80-90 MB range
  • Files that are hosted on a server in Asia
  • Inefficient code. Batch processing could likely help in this scenario
  • Some server issues on our end (very infrequent)
  • A slow internet connection on your end

Keep in mind that we need to download files in order to analyze them, so the bigger they are, the bigger the overall latency is going to be. And sometimes files hosted in far-away servers are just too tough for us to grab. :-/

We also down-scale all photos to 512 pixels in length so if you could send them in that ballpark it'd also help with latency.



How does a video response differ from an Image response?

The values returned for videos are similar to images except that you will get analysis for each second of video output, by default. Each second will be stored in brackets [ ] and you will be able to check them against a timestamp array.

Here's an example output from a 10-second clip with a frame rate of 1 per second. The original clip can be seen here.

Did this answer your question?