Optical Character Recognition


Convert the text in image to text

Example Go to our flickr photostream http://www.flickr.com/photos/112645524@N07/

Query Image http://farm8.staticflickr.com/7299/11589328513_3179a413a6_o.png


Response Text

POST /services/ocr

Replies face/set of objects with its predictions.

  • instance_token – generated token
Form Parameters:
  • query_url / query – query url link or query file.
Request Headers:
  • Accept – the response content type is “application/json”
  • InstanceToken – token to authenticate (optional if param instance_token is present)
Response Headers:
  • Content-Type – success content type is “application/json”
Status Codes:
  • 200 – success responce
  • 400 – when form parameters are missing
  • 401 – when param instance_token or header InstanceToken is not present present

Example in Python:

import requests
import json
headers={'InstanceToken' : 'YOUR TOKEN','Accept':'application/json'}
print response.content

Example in Java

public class pixuate extends AsyncTask<Void,Void,Void>

        protected Void doInBackground(Void... params) {

        String url="http://api.pixuate.com/rest/v1/services/ocr";
        HttpPost post=new HttpPost(url);
        HttpClient client=new DefaultHttpClient();
        List<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("query_url","http://farm8.staticflickr.com/7299/11589328513_3179a413a6_o.png"));
        post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        post.setHeader("InstanceToken","YOUR TOKEN");
        HttpResponse http_response=client.execute(post);
        HttpEntity en=http_response.getEntity();
        String s=EntityUtils.toString(en);
        }catch (ClientProtocolException e) {

        } catch (IOException e) {
        // TODO Auto-generated catch block
                return null;