“Easy Flickr API” Documentation by “sfadli” v1.2


“Easy Flickr API”

Created: 06/06/2011
Last update: 24/05/2014
By: Saud bin Mohammed (sfadli)
Email: iabosama@gmail.com

Thank you for purchasing "Easy Flickr API". If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!


Table of Contents

  1. findByUsername
  2. lookupUser
  3. lookupUser_getUsername
  4. getPublicPhotos
  5. search
  6. callAny
  7. credits

findByUsername( $username ) - top

@param: $username .. The username of the user to lookup, like this ( "iHosam" )
@return: userID like this: ( 42989267@N04 )

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo $EasyFlickrAPI->findByUsername( "iHosam" );
	/* it will be print "42989267@N04" the user flickr ID of "iHosam" */

lookupUser( $url ) - top

@param: $url .. The url to the user's profile or photos page, like this ( http://www.flickr.com/photos/abdul7amid/ ).
@return: userID like this: ( 31106030@N08 ).

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo $EasyFlickrAPI->lookupUser( "http://www.flickr.com/photos/abdul7amid/" );
	/* it will be print "42989267@N04" the user flickr ID of "abdul7amid" */

lookupUser_getUsername( $url ) - top

@param: $url .. The url to the user's profile or photos page, like this ( http://www.flickr.com/photos/abdul7amid/ ).
@return: userID like this: ( 31106030@N08 ).

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo $EasyFlickrAPI->lookupUser_getUsername( "http://www.flickr.com/photos/abdul7amid/" );
	/* it will be print "abdul7amid" the user flickr ID of "31106030@N08" */

getPublicPhotos( $url, $quantity = 12 ) - top

@param: $url .. URL of the user flickr like this ( http://www.flickr.com/people/fedraly/ ).
@param: $quantity .. [optional parameter] .. retrieve this number of photos ( max = 500 ) .. it's 12 by default!
@return: photos array .. see result of example.php for details.

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo '<PRE>';
	print_r( $EasyFlickrAPI->getPublicPhotos( "http://www.flickr.com/people/fedraly/" ) );
	/* it will be print Photos Array */

@param: $word .. [optional parameter] .. A free text search. Photos who's title, description or tags contain the text will be returned. You can exclude results that match a term by prepending it with a - character.
@param: $tags .. [optional parameter] .. A comma-delimited list of tags. Photos with one or more of the tags listed will be returned. You can exclude results that match a term by prepending it with a - character.
@param: $quantity [optional parameter] .. retrieve this number of photos ( max = 500 ) .. it's 12 by default!
@param: $license [optional parameter] .. The license id for photos. Multiple licenses may be comma-separated. goto this URL to know more about licenses id's (http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html) @return: photos array .. see result of example.php for details.

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo '<PRE>';
	print_r( $EasyFlickrAPI->search( "Queenstown" ) );
	/* it will be print Photos Array of "Queenstown" search word */
	
	echo '<HR>'
	
	print_r( $EasyFlickrAPI->search( "", "Queenstown" ) );
	/* it will be print Photos Array of all photos was tagged in "Queenstown" */
	
	echo '<HR>'
	
	print_r( $EasyFlickrAPI->search( "Queenstown", "", "", "4" ) ); /* number 4 is id number of this license: "Attribution License" .. for more you can goto this URL to know about license id's (http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html) */
	/* it will be print Photos Array of all photos was tagged in "Queenstown" */

callAny( $callArray ) - top

@param: $callArray .. This is an array elements will used on the call. @explain you can use this array as example array('method'=>'METHOD_NAME', 'params'=> array('param_1'=>'val_1') ) ....etc @return: Result as Array! see example I've used this function.

Here is an example:

	include('EasyFlickrAPI.class.php');	
	$EasyFlickrAPI = new EasyFlickrAPI;
	$EasyFlickrAPI->__KEY = 'YOUR_FLICKR_API_KEY';
	
	echo '<PRE>';
	$parameters = array();
	$parameters['method'] = 'flickr.photos.getInfo';
	$parameters['params']['photo_id'] = '4245834135'; // You can add parameters as you want by duplicate this line!
	$theResult = $EasyFlickrAPI->callAny($parameters);

	print_r( $theResult );
	/* it will be print results as Array */
	
	echo '<HR>'
	

Sources and Credits - top

if you face any problem you can send an email to me and I'll be so glad to assist you! (I mean it!)


Once again, thank you so much for purchasing "Easy Flickr API". As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the stuff on Codecanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.

Saud bin Mohammed (sfadli)

Go To Table of Contents