Photo Calls

The API provides three photo calls that tap into the Bank's Photo Library and allow photos to be retrieved based on country, keyword and more:

  • wb.photos.get
  • wb.photos.keywords.get
  • wb.photos.authors.get

The Photo Library provides more than 12,000 images that illustrate development through topics such as Agriculture, Education, Environment, Health, Trade and more.  For more information, visit the World Bank Photo Library.

 

wb.photos.get

Gets information about a photo.

Arguments

api_key (Required)
    Your API key.
id (Optional)
    The id of the photo.
country (Optional)
    The three letter ISO code of the country.
author (Optional)
    The id of the author.
keyword (Optional)
    Limit your search by keyword
topic (Optional)
    The id of the topic to search for
year (Optional)
    The year the photo was published (See the Date Format page for more information).
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of photos to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <photos page="1" pages="1" per_page="10" total="1">  
  3.     <photo id="90010895">  
  4.       <description>World Bank Beirut health clinic </description>  
  5.       <country id="LBN">Lebanon</country>  
  6.       <thumburl>http://secure.worldbank.orghttp://secure.worldbank.org/photolibrary/shared/SiteResources/PhotoLibrary/Images/01-A2.gif</thumburl>  
  7.       <lowresurl>http://secure.worldbank.orghttp://secure.worldbank.org/photolibrary/shared/SiteResources/PhotoLibrary/Images/secure/LowRes/01-A2.jpg</lowresurl>  
  8.       <highresurl>http://secure.worldbank.orghttp://secure.worldbank.org/photolibrary/shared/SiteResources/PhotoLibrary/Images/secure/HighRes/01-A2.tif</highresurl>  
  9.       <year>2002</year>  
  10.       <topics>  
  11.         <topic id="644300">Health Nutrition and Population</topic>  
  12.       </topics>  
  13.       <keywords>  
  14.         <keyword id="Bank">Bank</keyword>  
  15.         <keyword id="Clinic">Clinic</keyword>  
  16.         <keyword id="Development">Development</keyword>  
  17.         <keyword id="Projects">Projects</keyword>  
  18.       </keywords>  
  19.       <authors>  
  20.         <author id="1">Alan Gignoux</author>  
  21.       </authors>  
  22.     </photo>  
  23.   </photos>  
  24. </rsp>  

Error Codes

90: Invalid date “xxx” provided
           
The date provided cannot be interpreted.
91: Invalid date range “xxx” provided
           
The date range provided cannot be interpreted.
100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.


wb.photos.keywords.get

Gets information about a photo keyword.

Arguments

api_key (Required)
    Your API key.
id (Optional)
    The id of the keyword.
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of keywords to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <photokeywords page="1" pages="1" per_page="10" total="1">  
  3.     <keyword id="Abacus">Abacus</keyword>  
  4.   </photokeywords>  
  5. </rsp>  

Error Codes

100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.

 

wb.photos.authors.get

Gets information about a photo author.

Arguments

api_key (Required)
    Your API key.
id (Optional)
    The id of the author.
page (Optional)
    The page of results to return. If this argument is omitted, it defaults to 1.
per_page (Optional)
    The number of authors to return per page.  If this argument is omitted, it defaults to 10.  The maximum allowed value is 100.

Example Response

  1. <rsp stat="ok">  
  2.   <photoauthors page="1" pages="1" per_page="10" total="1">  
  3.     <author id="1">Alan Gignoux</author>  
  4.   </photoauthors>  
  5. </rsp>  

Error Codes

100: Invalid API Key
           
The API key passed was not valid or has expired.
105: Service currently unavailable
           
The requested service is temporarily unavailable.
110: API version “xxx” not found
           
The requested API version was not found.
111: Format “xxx” not found
           
The requested response format was not found.
112: Method “xxx” not found
           
The requested method was not found.
115: Missing required parameter
           
Parameters which are required have not been sent.
120: Parameter “xxx” has an invalid value
            The provided parameter is not valid.