Custom Flickr Badge API Documentation
While Flickr has a nice little tool for making Flickr badges, sometimes you just need more flexibility. Here I’ve documented the Flickr badge API and what HTML is being outputted so that you can seriously customize the way your photos are being displayed.
Starting Out
Regardless of what you’re going to be doing, you’ll always have this:
<script type="text/javascript"
src="http://www.flickr.com/badge_code_v2.gne?user=[The ID]">
You’ll want to replace the value for user with your own ID which you can obtain from idgettr. You may want to replace the @ sign with %40.
The JavaScript Parameters
There are several more parameters, which I will attempt to cover and document in the following table:
| Parameter | Type | Values | Definition |
| count | integer | A whole number between 1 and 10. | The number of photos to be shown. Defaults to 10. |
| display | string | latest, random | Whether the badge shows the latest uploads or random photos. Defaults to latest. |
| layout | string | h, v, x | Whether the photos are listed horizontally, vertically, or not styled at all. Defaults to horizontal. |
| source | string | user, user_tag, user_set, group, group_tag, all, all_tag | Where the photos are pulled from. After choosing one of these, you must then declare up to two more parameters specifying the tag(s) and/or the IDs of the group or set. These parameters are tag (string), group (integer value that can be found at idgettr), and set (integer that is found in the url of the specific set–i.e., when the url is …/sets/1632467/ the set ID is 1632467), respectively. |
| size | string | s, t, m | The size of the photo. s stands for square, t for thumbnail, and m for medium. (Note that the medium size here is actually the small size when looking at the “available sizes” on a photo.) Defaults to thumbnail. |
Styling the Output
Once we include the JavaScript in our page, it will output some HTML for browsers to display. Since this is all about customizability, we need to know what this code is in order to style it. Here’s what is basically outputted by the JavaScript:
<div id="flickr_badge_image1" class="flickr_badge_image">
<a href="[the photo page]">
<img width="[xx]" height="[xx]" src="[the url]" title="[The photo's title]" alt="A photo on Flickr" />
</a>
</div>
<div id="flickr_badge_image2" class="flickr_badge_image">
<a href="[the photo page]">
<img width="[xx]" height="[xx]" src="[the url]" title="[The photo's title]" alt="A photo on Flickr" />
</a>
</div>
<div id="flickr_badge_image3" class="flickr_badge_image">
<a href="[the photo page]">
<img width="[xx]" height="[xx]" src="[the url]" title="[The photo's title]" alt="A photo on Flickr" />
</a>
</div>
And so on. For each image, the ID will change by one integer.
This can now easily be styled with some fancy CSS to look however you want. 












Ah. I was looking for something like this a while ago. I just skimmed over it now, but when I get some spare time, I’ll take a look at this in detail and maybe use it. Thanks for posting this!
Glad somebody found it useful.
[...] FlickrBlog just gave some link love to my Flickr Badge API Docs. Sure they spelled my name “Elliot Swat,” but they got the link right, so I suppose that’s still good. [...]
Excellent documentation Elliot. This is highly useful for playing with mashups. At the same time I have a hard time squirting badge code into my personal websites – it almost seems inherently wrong. I still prefer (in my old fashion ways) to grab public feeds and doing my own parsing on the backend. However none of this is to take away your most excellent description and documentation skills you have done here. Will you be my personal JSDoc application assistant for any future widgets that I might write?
@Dustin: Thanks.
Something about dropping a script in there to get some photos does come as a little odd, but sometimes you just can’t beat simplicity.
As for your future widgets…we’ll see once you write ‘em. ;P
Flickr Badge + Lightbox2 Sample here.
http://feeds.feedburner.com/~r/emotion/~3/10038662/11
[...] Elliot Swan | Custom Flickr Badge API Documentation “ere I’ve documented the Flickr badge API and what HTML is being outputted so that you can seriously customize the way your photos are being displayed.” (tags: flickr javascript api css badge) [...]
[...] Yesterday I posted about my Custom Flick Badge. Today Elliot Swan had to go one better and post a documentation for the whole API! The documentation is awesomely useful, I intend to have a good read later tonight and then use it here. [...]
[...] Custom Flickr Badge API Documentation (tags: web design) [...]
[...] Elliot Swan | Custom Flickr Badge API Documentation [...]
[...] Elliot Swan | Custom Flickr Badge API Documentation (tags: javascript flickr) [...]
am i an idiot or something? i can’t seem to get my css to latch onto the outputted javascript. Is there a trick?
[...] So I’d got a wordpress theme working quite happily – but now I wanted photos, books and ma.gnolia links. Implementing the Flickr badge was quite easy, thanks to Elliot Swan’s Custom Flickr Badge API Documentation, the ma.gnolia links were much more straightforward once I’d found the linkroll output html, and the Librarything widget was more of a challenge, but I got there in the end. I also customised my own feed icon for the bottom right hand corner – I didn’t think orange would ‘go’. [...]
ab.fab! thanks so much.
do they let you put in &l=cc or &s=int ?
that would be good – to have creative commons pictures and interesting too, like in the search box ..
Cool. Really helpful. What I’ve also been looking for is a tutorial on how to put your own background behind each photo thumbnail rther than the standard border. Probably easy but i’m not technically minded!
[...] Elliot Swan | Custom Flickr Badge API Documentation (tags: blog cool css javascript tips WebDesign flickr api badge Design) [...]
This is awesome! Very mice tutorial.
[...] If you’re not satisfied with the typical “badge” photo display options offered by Flickr, check out Elliot Swan’s guide to customization. [...]
Write a comment here.
Also, I want to show more than 10 photos at a time.. isn’t there a way?
Excellent tutorial. Thanks for sharing the info!
Thanks for the info. Exactly what I was looking for, but unfortunately, I have yet to get it to work with the tag parameter. I have added the user and tag to the parameter string, but cannot get the photos for the tag to display.
I checked the Flickr forums, and discovered many other Flickr users have been unable to display photos by tag using the “tag” parameter.
url
[...] Slidoo Ama senin sağ sütündaki galerin farklı diyorsanız bu sitede en üstteki scripti kullanabilirsiniz. İnce ayarlar içinse buradaki tabloya bir göz atın. Kategori: Fotoğraf | Saat: 8:44 am | del.icio.us |digg | [...]
Nice tutorial but how the heck do you use a user set? I’ve tried 20 ways and nothing works.
Here’s what I have, I get to source and…
source=user_set now what? do I add _id=the set number or what?
[...] Custom Flickr Badge API Documentation | Elliot Swan (tags: flickr photography api) Posted by roedward Filed in Uncategorized [...]
I managed to get two rows of photos by floating them, but I’m sure there are other ways to do this. It would have been nice if flickr offered blocks of photos, 3×3 for example. Their list of attributes is even cryptic.
Here’s where I put my badge:
http://www.geocities.com/naukeagstudio/flickr.htm
Thanks for the tutorial, though.
Damn! I was about to write something like this when I saw the link to this in a Help Forum topic.
At least I get to add a new link to my collection.
wow this is pretty easy im new to this and so this helps me out alot thanks for the help
Great stuff. I was looking for this.
What if I want the images to show up in a lightbox?
What is bumburbia?
Ill help. See what happened. Buck is always oops penny smith right, are angry, and advise.
all news here
Our site the most qualitative source of the information on the mortgage, insurance of the mortgage,
tax deductions, stages of registration of the mortgage.
We are glad to you to present the fullest information on these themes.
Welcome to our site.
I tried to use a code for my old website http://roadlessunraveled.com to use on my new one. I want it to be in like a 4 square grid but when I put it in it turns the whole page blank, any idea why?
Have a link I can see?
Sorry, it’s what I used for the form under website. http://lifeisnotamovie.net.
Oh got it. You just forgot to close the
scripttag:Should be:
That is so much help, thank you. Do you know how to alter the borders and to put it in a grid or at least horizontal?
Now I am trying to just get it to go horizontal and cannot seem to make it happen.
Hey, just i just wanted to remind, tha global I4oTuFskPCc4 is near.
Thanks, that’s a great help, even three years after your original post. This is the first explication I’ve found of the Flickr badge parameters.
Is there a way to control the flickr photo page be opened on a new browser? Where can I place the “target=_blank” tag?
Here’s a weird problem – the photos contained in this group…are not in the group at all…why would the code do that? Check it out – all the photos are from the group moderator’s photostream (neruffnecks).
http://www.flickr.com/badge_code_v2.gne?show_name=1&count=9&display=random&size=s&layout=x&source=group&group=979804@N25
Any ideas? The Group’s ID in idgettr is 979804@N25
Привет! Мы предлогаем аренда квартиры в Москве без комиссии!
Звоните, все расскажут и покажут. Большой выбор квартир на сайте
Does anybody have a working script which will create a badge but have the images open in a lightbox rather than at flickr?
I was looking to troubleshoot flickr badge but ended up learning more. Thanks for the tips.
is there a way to let the pictures pop up in a new window? on the flickr “show picture” page or as a solo picture?
I need this function because Flickr doesnt allows pictures to open within frames and shows a silly error message.
any help is welcome!
thx
I’d like this ability also. I found a nice javascript/css method of attaching a class to do the equivalent of target=”_blank” but can’t figure out how to pass the class to the thumbnail image links.
oh I see this question is already here. any solutions?
Any Idea how to speed up the updating of a badge? Got 4 badges running but they take hours to refresh with the new pictures being send in…
http://www.sigzane.com/mm
Any ideas would be great…. I tried to look up a scriptless badge but had difficulty formatting it to a 100 width thumbnail in vertical format.
Aloha, and mahalo
Is there a way to make it use the large or original sizes, so the badge can be more like a gallery?
http://sarahritchie.com/new/gallery.html
[...] un “badge” Flickr Pubblico ora la traduzione di un articolo molto interessante trovato qualche giorno fa su come creare stili personalizzati per le custom gallery di [...]
wow, this is EXACTELY what i was looking for.. thank you for sharing! XD
This looks great. Is one able to automatically pull the set name, the photo count in that set and the date of creation too?
How is it going you most definitely got yourself a well made site Only thing about it I do not like is all of the worthless comments
have been visiting ur site for several days. really enjoy your posts. by the way i will be conducting a research regarding this subject. do you know other great blogs or maybe online forums that I can get more info? thanks a lot.
i also like the resizing tool of Flickr aside from the easy upload and download interface it provides.~.
This page appears to get a good ammount of visitors. How do you promote it? It gives a nice unique spin on things. I guess having something useful or substantial to post about is the most important thing.
Flickr is the best photosharing tool that can resize my pictures so well ::
Is definitely blogengine a lot better than live journal in some way? Really needs to be because it’s increasingly popluar as of late.
[...] http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/ [...]
[...] http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/ [...]
Thanks for the share, I have been reading online all day and this was
actually worth reading.I’ll love to read more from your side… Thanks
Loving this the post as it is in reality the sweetest on this valuable topic. I agree with your conclusions and will thirstily look forward to your upcoming updates. Saying thanks will not just be enough, for the wonderful clarity in your writing. I will at once grab your rss feed to stay informed of any updates.
I usually do not understand until the end of that which is written here, because I do not know English so well. You can write it more sort?
Can you post or show more than the default number of images??
Was wondering if users can show as many images as they want…
Andy, no. The maximum is 10.
[...] http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/ [...]
Thanks for this great tutorial !
Awesome tutorial, thanks for sharing
Hair Loss By Medications
[url=http://www.scfcsol.com/]order adipex without prescription[/url]
Patients should talk to their doctors about their side effects to determine if the benefits still outweigh the risks.
http://www.scfcsol.com/ – generic adipex without prescription
Excellent informativ publish. Thank U for helping details. Lookin’ forward for ur next report. Cheers
Excellent post. It is truly assist to us. Its offer us plenty of curiosity and enjoyment. Its opportunity are so amazing and targeting style so speedy. Its seriously a excellent article. It offers me a lot of pleasure and interest.
Awesome tutorial, thanks a lot for sharing.
I’ve learn several just right stuff here. Certainly price bookmarking for revisiting. I wonder how much attempt you put to make this type of fantastic informative website.
You’re so awesome! I dont suppose I have discover anything at all similar to this just before. So good to locate an individual by incorporating unique applying for grants this particular subject matter. realy many thanks for starting this kind of upwards. this site is a thing that’s desired on the net, somebody with a little bit of creativity. beneficial project for bringing a very important factor a new comer to the web!
Top notch tips, We added the following so that you can our Feed. What would anyone propose with regards to your site that you choose to designed a couple of days back?
[...] Elliot Swat documents the Flickr Flickr badge API and HTML output so that you can "seriously customize the way your photos are being displayed." (some nerdiness required) [...]
Took me the perfect time to examine the many reviews, however seriously liked your content. This turned out to be Very beneficial with me and i’m likely to many of the commenters in this article! It’s always fine when you might don’t just be informed, but will also interested! I am sure this is pleasurable offering this report.
I wanted to draft you one tiny observation in order to thank you very much the moment again about the beautiful opinions you’ve provided on this page. This is simply strangely open-handed of you to provide easily exactly what many people could have supplied for an e-book in order to make some profit on their own, mostly now that you could possibly have done it if you ever wanted. Those tips in addition served as the good way to understand that other people have a similar dream like my personal own to learn a little more related to this issue. I know there are some more pleasant periods ahead for many who looked at your blog post.
I happen to be writing to let you understand of the superb discovery our princess undergone using your webblog. She came to understand many things, which included what it is like to possess an amazing teaching mindset to have the others just grasp some impossible subject matter. You really did more than our expectations. I appreciate you for supplying these interesting, trusted, revealing and in addition unique tips on the topic to Mary.
Is it me or is the response from flickr different since this was published all I can see is javascript being outputted? :/
merciii bc
I love the precious information you be offering for your articles. I will bookmark your weblog and have my kids take a look at up here generally. I am reasonably positive theyll be informed a whole lot of new stuff right here than anyone else!
The subsequent time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I do know it was my choice to read, however I truly thought youd have something fascinating to say. All I hear is a bunch of whining about one thing that you would repair if you happen to werent too busy searching for attention.
Howdy just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Safari. I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know. The design and style look great though! Hope you get the problem solved soon. Thanks
These coach handbags coach was created by coach organization outlet.
The particular tailor made lv wallet exactly like Gucci, Chanel, and also Hermes and so forth. are usually costly and they are made out of helpful good quality substance.
Can I just say what a aid to seek out somebody who actually knows what theyre talking about on the internet. You definitely know easy methods to carry an issue to gentle and make it important. More folks must read this and perceive this facet of the story. I cant believe youre no more widespread because you definitely have the gift.
I just received this email with the online casino bonus offer:
“…160% WEEKEND! Your exclusive 160% at between Wednesday 13 December and Monday 19 December with your first 20$ you will automatically qualify for 160% ABSOLUTELY FREE.
Use Promo Code: FREE160 at [b][url=http://www.vegasvipsweepstakes.com/]online casino bonus[/url][/b] site…”
Even more – they say all US players are welcome. What do you think, worth a try?
Wonderful goods from you, man. 301 Moved Permanently I have understand your stuff previous to and you’re just extremely great. I really like what you have acquired here, really like what you’re stating and the way in which you say it. You make it entertaining and you still take care of to keep it smart. I can’t wait to read far more from you. This is actually a great 301 Moved Permanently informations.
Alguien sabe como hacer que se puedan visualizar más de 10 imágenes?
[...] Flickr 有一个建立你自己的 Flickr 徽章的服务,可以通过它来显示相片。另外,在 WordPress 里可以通过 flickrRSS 插件来显示相片。以上是通过 Flickr 调用 API 来显示相片。 引用:http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/ [...]