Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


A simple script for using Google's Vision API. Takes a comma- or tab-separated file containing a column with image URLs as input, sends images to the Vision API and puts the detected annotations back into the list.


Follow the following steps for installation on a php equipped machine:

  1. Download, unzip, and place the script files in some directory.
  2. In the same directory, create three folders (“cache”,”data”,”outputs”) and make sure they can be written to (e.g. via chmod on Unix-like systems).
  3. Go to and get an API key for Google’s Vision API.
  4. Rename the config_sample.php file to config.php and make the following edits:
    • insert the file name containing your image URLs (local or online) into the value of the $inputfile;
    • specify the name of the column containing the URLs in the $urlcolumn variable;
    • specify the column delimiter in the $csvdelimiter variable (“\t” for tab-separated files or “,” for comma-separated files);
    • put your API key into the $apikey variable;


Run the script in a terminal using by typing “php vision.php”. The script should start counting up to the number of images and store the answers from the Vision API in the cache folder. If the script is interrupted, it will retrieve the data from these files instead of hitting the API again. When finished, the script will write a new file into the outputs directory with the API results added as new columns.


Written by Bernhard Rieder, University of Amsterdam,,

This is as-is software, no support is provided.


A simple script for using Google's Vision API that will possibly develop into an actual tool.




No releases published


You can’t perform that action at this time.