FourSquare Mayor Checkin Program w/ Source Code

DEPRECATED: This utility has been discontinued as of 08/11/11 since FourSquare has deprecated the v1 API that it relied on and rolled out the new v2 API. The application source code is still available for anyone interested in making a modified version themselves.

Update #2: This application now has an official software product page with all the links for download, usage and source code.

If you just want to download the program and run it, scroll down the Download section below. Thanks!


A few weeks ago we wrote about Mayank Lahiri’s working FourSquare checkin hack that allowed you to check in from anywhere provided you had the Venue ID and GPS coordinates for the place you were trying to check into. Mayank’s hack was his own brain child (and he deserves all the credit for the idea and working implementation) that came to him while toying with the FourSquare API and realizing how flaky the security on the API was.

Mayank’s original implementation was done with 9 lines of Perl, but since then a few other people have submitted Ruby and revised Perl implementations to him.

For what it’s worth, I implemented this solely out of curiosity and just wanted to hack together something quick and somewhat polished. I don’t hate FourSquare or think gaming checkins for free perks at your favorite resturaunt is alright. Just wanted to clear that up.

What About a Nice GUI?

When I first read that story, I immediately did what any good hacker would do… sat down and tried to re-implement it in my programming language of choice (Java) and wrap a GUI around the whole thing. Unfortunately I couldn’t seem to get my requests to auth against the FourSquare API and kept getting back HTTP 401 error codes. I put the project down for a few weeks and only today after Mayank shared some clarifying implementation details with us did I decide to dig back in and figure out what was going on.

First thing I did was install Wireshark so I could watch the actual packet contents of my outgoing POST to the FourSquare API:

You can’t see it here (the censored part) but once I expanded the Authorization block to view the Credentials values, the password that is Base 64 encoded in that string was totally wrong; this gets chalked up to me doing something dumb with JPasswordField.getPassword().toString() and not remembering exactly what I was actually to-stringing.

After fixing that snaffu and tightening up some other code, everything started working and I checked into the Cracker Barrel down the street a few times for good measure:

After I had that working I decided to do up a quick UI in NetBeans to make everything a bit nicer to use. I actually mocked the UI up twice… once in IntelliJ which was a painfully abysmal process and then a second time in NetBeans. This is what I came up with:

It would be trivial to take this and make a webapp out of it, I may do that and add it to our AJAX Tools Suite at some point. If *you* want to do it, the source code is available at the bottom of this post, but it is GPL’ed so please repsect that.

In the mean time, here is an OK-looking desktop app for your use in becoming mayors of everything :)


You can read more details about how to find the Venue ID, Latitude and Longitude of the places you want to check in to from our previous post where we analyzed Mayank’s implementation. I also put tooltips on the “?” icons so if you hover over those it will tell you.

For Quick Reference:

  • Venue ID: You can find this by opening the page on for the venue you want to check into, then looking at the URL in your browser (e.g. That last integer after the “venue/” part is the Venue ID. Just copy and paste it.

(Click to Enlarge)

  • Latitude & Longitude: Get the exact address off of for your venue and paste it into Google Maps. When the venue is centered, copy the link address for the Link link (linkity link link!) on the far right top of the Google Map (see screenshot above) and paste it anywhere you can look at it; for example into Notepad. Now, look for the sll argument (highlighted above in red) that value is the latitude and longitude separated by a comma; copy and paste those values into the program.

Download the Program

Download the program here.

After you have downloaded it, unzip it and double-click run.bat to run it or if you are on Mac or Unix, you can do chmod +x and then run to start the program. The actual command both of these scripts is running is just a simple:

java -jar foursquare-checkin-hack.jar

NOTE: You do need Java installed on your computer for this to work. You can install Java fairly painlessly by going to and walking through the install process.

The app was written using Java 6 (1.6.0_21) on Windows, so you will need some runtime of Java 6 on your computer to run it.

Get the Source Code

The FourSquare Checkin Hack is written in Java (6) and should work on Windows, Mac and Linux. You can grab a zip of the entire project (including the Source Code) here. The license for this code is GPL.

Update #1: Source code now available from GitHub!

The only dependency is the Apache Commons Codec Library for the call to the Base64 class to do the encoding. If you grab the runtime download or the project, it’s included already.

If you are just curious about the meaty parts of the code that do the POST, here is a code snippet for you. All the rest of the code is just UI, form validation and other ancillary business. This is the meat and potatoes:

public static final String HOSTNAME = "";
public static final String API_URL = "http://" + HOSTNAME + ":80/v1/checkin";
public static final String USER_AGENT =
  "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C10 Safari/419.3";
public static final String CONTENT_TYPE = "application/x-www-form-urlencoded";
... SNIP ...
String encodedAuth = Base64.encodeBase64URLSafeString((email + ':' + password).getBytes());
// Muddle up the GPS coords to make them seem more natural
double lat = lat + (Math.random() * 0.0003);
double lng = lng + (Math.random() * 0.0003);
// Create the query string to be posted to the API
String args = "vid=" + venueIDTextField.getText() + "&private=0&geolat=" + lat + "&geolong=" + lng;
// Create the connection to the API
URLConnection connection = new URL(Main.API_URL).openConnection();
// Make sure we POST
// Setup the POST arguments
connection.setRequestProperty("Host", Main.HOSTNAME);
connection.setRequestProperty("User-Agent", Main.USER_AGENT);
connection.setRequestProperty("Content-Type", Main.CONTENT_TYPE);
connection.setRequestProperty("Authorization", "Basic " + encodedAuth);
connection.setRequestProperty("Content-Length", Integer.toString(args.length() + 2));
// Write out our query string arguments with our POST
DataOutputStream output = new DataOutputStream(connection.getOutputStream());

If you do download the project, all this stuff is pretty heavily commented for you so you can get through it.


, , , , , , , , , , , , ,

100 Responses to FourSquare Mayor Checkin Program w/ Source Code

  1. null September 15, 2010 at 2:58 am #

    What’s the point of cheating FourSquare. You can’t become the Mayor by checking in 50 times in one day, it only counts a single check-in everyday for “mayorship”. The only thing running this program and clicking the app multiple times will do is annoy your friends.

    • Riyad Kalla September 15, 2010 at 3:07 am #


      I’m not sure why only 1 checkin per day stops you from becoming the mayor… I could sit here at my desk for the next 6 months and checkin at the Eiffel tower until I was the mayor.

      As for the relevancy of mayorship-ness-dom, FourSquare is partnering with more and more vendors/resturaunts/etc. to provide special offers for “mayors”; offers like drinking for free or big discounts. I don’t know if 4sq is already tapping this source for income, but they eventually will… so there is absolutely a “reason” to become a mayor if your favorite place patronizes them.

      • null September 15, 2010 at 3:12 am #

        Ok, so you’re the “mayor” of the “Eiffel tower” big deal. While I understand some places do give you perks for being the mayor, if they are truly are your favorite place you should be checking into them as you go there and not cheating it.

        If people start doing this and it becomes mainstream do you think places are gonna want to continue giving out these perks to “customers” that cheat? It’s gonna ruin the system and then less and less companies are going to be giving perks to “mayors”.

        • Riyad Kalla September 15, 2010 at 3:27 am #

          Are you for real dude?

          I post a GUI re-implementing a hack discovered a month ago for one of the most popular social media sites in mobile (that is still wide open) and you are hung up on the ethics of this and cannot see how this helps?

          Then I’ll say that this helps publicize the hole that FourSquare has and will motivate them to close it.

          As an example, it wasn’t until Martin Kou was wiresharking his FourSquare checkin data that he find out their mobile app was sending passwords in plain text.

          He blogged about it, there was a firestorm response to it and FourSquare fixed it a few days later.

          FourSquare has every intent of monetizing their “perk” system with vendors into advertising revenue. If they are going to be making money from vendors to use the perks system, yes I absolutely fucking feel that exploits like these should be publicized and FourSquare owes it to the community and vendors to create a *secure* system.

          This doesn’t hurt the venues themselves, this HELPS them. Let’s say I kept his to myself, didn’t say a damn thing about it and just abused it privately myself.

          What now? Now FourSquare continues to work with their unsecured approach to their perk system, venues pay more for advertising as the system gets more popular, and I walk around town and eat sandwiches for free at all my favorite shops that I’m a mayor at after a few weeks of clicking.


          I publish this, they get embarrassed and fix the hole.

          — This is like the Facebook “Like” hack that was going around 2 weeks ago. They didn’t fix it until they were made aware of it by mass publicity surrounding it, now it’s fixed and Facebook is a better site for it.

          • null September 15, 2010 at 3:56 am #

            Wow alright this is turning into some fun now.

            I know this is old, and I’m not hung up on ethics, I see this as a useless tool. This isn’t going to make FourSquare “fix” the “issue”. So users can now check-in to places that they actually aren’t at. But how else is FourSquare suppose to allow users to check-in, without using the GPS data and sending it out. I’m sure you’re gonna say they could encrypt the GPS data and add some other challenge stuff, but how is that going to help? They have an API that’s documented and so anyone would be able to continue to check in like this. Unless of course they limit FourSquare to only their official app, highly unlikely.

            Ok, so we FourSquare sent passwords over plaintext, guess what Base64 isn’t going to help all that much either. It’s pretty easy to decrypt that. And then your line about “wiresharking his FourSquare checkin data”, wow really? It’s not called “wiresharking”, it’s called packet sniffing. I guess wiresharking is a verb now.

            Great for FourSquare, this isn’t an exploit. A user checks into a place, their app grabs the GPS coordinates and sends it all to FourSquare. You’re doing exactly what the app is doing, the only difference is you are inputting your own GPS data. Wow, congrats to you and the original finder of this “exploit” you made a FourSquare app for devices that don’t have GPS built-in.

            As I said before check-ins for Mayorship only count 1 checkin per day. So that is their security control. Sure it’s lame, but you know what, if the Starbucks down the street gives you a dollar off coupon for your Mayorship, then you certainly deserve getting that dollar off for running a program. I know with most venues that have perks, they have Mayors that go there every day, so you have to compete with them. So good luck, it’s certainly worth the outcome, perks and security wise.

            Heres the fun thing, you say argue that you can now check in anywhere and then walk around town and eat sandwiches for free. Well you still have to goto the place, so why even bother with the program if you’re gonna be going there anyways.

            FourSquare isn’t going to get embarrassed by your blog post and fix the hole.

            Are you comparing this hack to the Facebook clickjacking hack? This is not even close to that in anyway. Wow.

            • Riyad Kalla September 15, 2010 at 4:13 am #

              > Wow alright this is turning into some fun now.

              No it isn’t. Neither of us think internet arguments are fun, that is why this is so damn frustrating.

              >I know this is old, and I’m not hung up on ethics, I see this as >a useless tool.

              I can appreciate that. What I’m annoyed by is your inability to see how this isn’t useless to everyone that uses FourSquare. I can see this hack being anything from useless to hilarious (pranking your friends… a user asked about that specifically in another thread) to beneficial in the real world in the form of a perk.

              I don’t *agree* ethically with gaming 4sq, but that wasn’t the point of the post in the first place. It’s just a hack for the user to use it however they want.

              > This isn’t going to make FourSquare “fix” the “issue”.

              How do you know what FourSquare will do in response to this?

              >But how else is FourSquare suppose to allow users to >check-in, without using the GPS data and sending it out.

              I don’t know the answer to this.

              > Heres the fun thing, you say argue that you can now check > in anywhere and then walk around town and eat sandwiches > for free. Well you still have to goto the place, so why even > >bother with the program if you’re gonna be going there >anyways.

              The point being that I don’t need to go to Denny’s down the street 20 times before getting a Grand Slam Breakfast for free.

              I think we both agree that the ethics of gaming 4sq is shitty and/or pointless for the most part, but that was never the point of the post.

              • null September 15, 2010 at 4:28 am #

                Internet arguments are certainly a lot of fun when you’re bored and need to pass time, but after you’re occupied with something else they do end up getting pretty boring. With that said, I suspect you have better things to be doing right now, and I plan to sleep this can end.

                Don’t be annoyed by my inability to see how this isn’t useless. Everyone has things they don’t need or want, and will consider them useless. I am a man that enjoys a prank, but for me, pranking my friends with this would be useless, for others I can see it being fun. So I take back what I said about it being useless.

                I use FourSquare to check-in to places so that my friends know where I am and if they are near by we could hang out. I couldn’t care less about perks, but if a friend of mine was using this to gain them, it would just get annoying to me to see their updates all the time. So again I have different uses and I could see someone that wanted to “game” the system wanting to make it easier for them.

                FourSquare added this in place to fix the original “check-in” hack. I am sure they thought about it and then added this layer and knew that people could “hack” it when they implemented the requirement of GPS data for certain spots. So sure they might fix it, but I think to them it’s fine how it is.

                Right, you don’t have to goto the place 20 times now, but surely someone else might already, and so you’d be competing against people that actually do go. It might take more time than it is actually worth. But that’s for the user of the app to decide, not me.

                You’re right we do both agree on the ethics of gaming FourSquare, and you’re also right your post wasn’t about gaming it. It was about the work you did creating a GUI app, and to help raise awareness of this problem. So good work on that, and I hope it works out for you.

                • Riyad Kalla September 15, 2010 at 4:45 am #


                  You are a solid guy; I apologize if my tone was dismissive or antagonistic previously.

  2. Kev September 15, 2010 at 8:16 am #

    Very interesting thread. 😀 As I commented on the other topic, this tool isn’t useless to me at at all. My problem is that I have a person near me who’s been gaming the system for the past couple of months because he a) is too lazy to use 4sq the way it was intended to be used and b) he’s intentionally harassing me. I asked him to quit gaming the system and, while I could have used a little less aggressive, I wasn’t swearing at him. His response was “It’s a !@$%@%& iphone app, get over it.” So, since it’s just an app and he doesn’t seem to understand how he’s making it less than fun for others I just plan on returning the favor.

    BTW, you might ask how I know he’s harassing me? He’s stolen the mayorship to my house on several occasions and said he just does it because he lives close and the app lets him. It’s funny that I put another venue even closer to him and he’s never checked into it. It doesn’t look like he uses the app as much any more which should be a relief to anyone else who has to put up with him. I’m more frustrated with 4sq support ignoring it when it’s been reported.

    I also agree with Riyad that tools like this should prompt 4sq to do something to fix it. It’s certainly not an easy thing to fix without likely ruffling some feathers. API client keys come to mind much the way google does it for some of their APIs but there are plenty of potential shortcomings with that as well. Yeah, it’s more work for 4sq but it’s in their interest to make sure their data has some kind of integrity otherwise it’s 4sq that’s useless and not the tools that exploit it 😉

    • Riyad Kalla September 15, 2010 at 8:23 am #


      Some random guy you don’t know has made himself mayor of your house? That is maddening.

      See if you can make yourself mayor of his bedroom and if he appreciates the reciprocation :)

      • Kev September 15, 2010 at 8:33 am #

        It’s funny how people use foursquare. I’ve seen at least one chick who’s got every room of her house as a venue. My first thought was to steal the mayorship of her bedroom but then that wouldn’t make me any better than this other guy, right?

        On the other hand, Seymore Butts is NOT me, but he may very well be the mayor of this guy’s bedroom by the end of next week. 😉

  3. awartany September 24, 2010 at 3:31 pm #

    Not working. Running under Windows 7. It says working and stays like this.

  4. PTZ September 25, 2010 at 11:56 am #


    I appreciate the time and effort you’ve put into this simple and easy to use tool. However, I’m having the same problem as awartany, I get the “working” status and it hangs.

    What I’ve done:

    I followed the directions as written.

    I’ve checked and rechecked my 4Sq login, password, venue I.D., Long. & Lat.

    Upgraded to Java Version 6 Update 21

    Restarted my PC.

    Disabled my firewall

    Tried running it three times in about an hour and used a different venue. I let run for
    20-30 minutes each time

    What I am running:

    Windows XP Media Center Edition Service Pack 3.

    I’ve checked my FourSquare account and there are no check-ins.

    Any suggestions?

    • PTZ September 25, 2010 at 11:58 am #

      Forgot to mention I’m using a 32-bit machine. I’m not sure it matters.

      • Riyad Kalla September 27, 2010 at 12:04 pm #

        PTZ, shouldn’t matter.

        I went back through the code and the *only* part that might explain the blocking is the preference store using Java Prefs API. I wasn’t checking for null if I cannot get access to the user’s pref root node, and that was throwing an NPE which wasn’t getting caught.

        Try and right-click on the run.bat file and select “Run as Administrator” and see if that helps.

        If it does, then I’ll do a new build with protections against that, which should work without admin mode.

      • Riyad Kalla September 27, 2010 at 12:10 pm #

        PTZ — nevermind, I put together a new build for you to test, you can grab it here.

        Let me know if that works.

  5. Riyad Kalla September 25, 2010 at 4:06 pm #

    Guys, I will look into this issue Sunday night. I am not sure off the top of my head why it is hanging, but I’ll figure something out.

  6. Banshee September 26, 2010 at 7:30 am #

    What’s the difference between running this java app vs just going to (mobile site) and checking in anywhere in the world from there? Works from any browser as well and does not verify location. Just curious.

    • Riyad Kalla September 27, 2010 at 12:10 pm #

      Banshee, good question, I’m not really sure. Never used the site.

      • Banshee September 27, 2010 at 12:14 pm #

        I’m not up to date with programming anymore, was something I was more in tune with ages ago. I just saw your post and figured the site might be of use instead of writing code like crazy to implement your location when the mobile site just lets you check-in where ever from where ever. Just a thought is all :)

        Kiss method I guess, but the obstacle of making what you created work proper is still there, good luck with the code! :)

        • Riyad Kalla September 27, 2010 at 12:51 pm #


          I just took a look at the site, and it seems to estimate your location from your phone’s GPS coords or IP address location (very broad guess) and you narrow it down by typing in the name of the place you are at.

          If you type in something out side of the acceptable range, 4sq ignores you — like if I typed in “Empire State Building” and I’m in Florida.

          This is different than the hack above, where you tell 4sq exactly where to check you in.

          For example, right now, I could check into the Eiffel Tower in Paris even though I’m on the other side of the planet.

          Still appreciate the link for mobile 4sq though, I didn’t know about that site, just the apps they have.

          • Banshee September 27, 2010 at 12:54 pm #

            Hey, no prob, good catch. I use it primarily for checking in when my foursquare app tells me I’m too far away for something when I’m standing right next to it, lol. Or if I forgot to check into some where and I’m not there anymore. I’m in Orlando myself here. You’re way would also still be useful should they take down the mobile site or restrict it any so that I could do what I use it for. Keep up the good work! :)

    • Joop deBruin January 17, 2011 at 10:57 am #

      From the Foursquare mobile site: Mobile web check-ins can earn you badges but not Mayorships.

  7. PTZ September 27, 2010 at 2:09 pm #


    I downloaded v1.1 and ran it under the admin account. It’s hanging at “Base64 Encoding Credentials” – 23 minutes so far. I’m going to install Ubuntu and try running it under Linux to see if I can get it to work.

    • Riyad Kalla September 27, 2010 at 6:45 pm #


      Very strange! That is literally 1 line of code that calls into Commons Codec Base64 implementation to encode the chars… I don’t even know how that code could be hanging… let me know how Ubuntu goes… I’m really surprised.

      • PTZ October 16, 2010 at 11:44 am #


        I finally got around to installing Linux (Ubunutu Netbook 10.10 English install). I followed the instructions and “chmoded” the file. I tried to run the file, but nothing happens. I even tried running the codec .jar file in the lib folder from the terminal to see if it’d help. I got the following message:

        “Failed to load Main-Class manifest attribute from commons-codec-1.4.jar.”

        I installed Sun’s Java version 1.6.0._22 successfully.

        I even tried to use the perl script with no success in Ubuntu. As it did in XP, it hangs and produces no result. I checked and rechecked my data and base64 code with no success.

        I finally went to , changed location, and checked in. It actually worked from my Firefox browser.

        Thanks much for your time effort. I wish I could have gotten it to work for me.

        – PTZ

        • Riyad Kalla October 26, 2010 at 6:36 pm #

          Ptz, you cannot run the codec jar directly, the command you need to launch the app is in the file, you need to make it executable with chmod +x first and make sure that ‘java’ is in your path, or just edit the command to fully qualify the path to the Java executable

  8. Mike September 28, 2010 at 7:40 am #

    I’m running this app in windows XP using the most current version of JAVA. I’m using v 1.1. I also hang at “Base64 Encoding Credentials”

    • PTZ September 28, 2010 at 6:18 pm #

      When trying to install Ubuntu, it messed up my partition. Weird thing is I never had any prompts and could only see the splash screen and the BG. I was able to recover my system and files. However, it’s at pre-service pack 3. I thought I would try using it in this version. After installing the latest version of Java, I ran the program again only to have it hang at “Base64 Encoding Creditials” I thought I’d let you know. I was never able to get into Ubuntu to try it.

    • Riyad Kalla September 29, 2010 at 7:51 am #

      Mike, if you open a command prompt and type “java -version” what do you get?

      • Riyad Kalla September 29, 2010 at 7:52 am #

        Mike, also, are you on a default English Windows setup, or is the default language something else? I’m wondering if the issue is how I’m encoding UTF-8 chars.

        • DD October 1, 2010 at 11:17 am #

          I’m having the same issue running on XP, lagging on “Base64 Encoding Credentials…”

          Tried running the commons-codec directly and got an error message: Failure to load Main-Class manifest attribute from (PATH)

          Running with:

          java version “1.6.0_21”
          Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
          Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)

          • Riyad Kalla October 5, 2010 at 4:26 pm #

            DD, how did you try and run codec directly?

            I am bamboozled by this hangup… are you on an English windows install?

            • DD October 7, 2010 at 1:36 pm #

              Navigated to lib folder
              right click/Open with: Java(TM) Platform SE Binary
              Error: Failure to load Main-Class manifest attribute from (PATH)

              And yes, using English install

            • sad November 9, 2010 at 12:45 am #

              i’m getting this base64 encoding stuck screen too :(

            • osman December 8, 2010 at 8:55 am #

              hi riyad,

              I have:

              java 6 Update 22,
              english windows,
              foursquare checkin hack v1.1
              windows xp home edition service pack 3


              same problem ( Base64 Encoding Credentials… )

              • Riyad Kalla December 8, 2010 at 9:51 am #

                damn damn damn, I’ve never seen this and Googling for a solution comes up with nothing, but what happens *right* after that status update, is a call to Jakarta Common’s Codec Base64 class to encode 2 strings.

                Base64 encoding is a really straight forward process, doesn’t require anything complex and shouldn’t trigger any security violations that would cause the hangup. You can try running “cmd” as Administrator then try running the app to see if it *is* a security issue, in which case I might have to rethink how I’m doing the Base64 encoding (embed the class directly in the app).

  9. herain November 30, 2010 at 2:57 am #

    i get hanged on 64 base encoding to. helpppp

  10. thempr December 15, 2010 at 1:30 pm #

    base64 encoding credentials getting me down. any solution so far?

    • Riyad Kalla December 15, 2010 at 5:02 pm #

      I’ve tried a few different things on my end and it looks like I’m going to have to actually replace the Commons Codec library which is a bummer — there is only 1 other library I know of that impls a comprehensive Base64 encoding algo in Java. I’ll look at replacing that next week and releasing an update for everyone.

      Sorry for the delay guys, this has been a bitch to investigate because I cannot reproduce it.

      • osman December 16, 2010 at 12:30 am #

        I’m looking forward to your answer..

  11. Riyad Kalla December 23, 2010 at 8:09 pm #

    Alright guys sorry for the delay, I reworked the project a bit and you can grab the updated version here. I also updated the download and source-code links in the story to point at the new versions as well.

    I totally replaced the Base64 encoding algorithm with another implementation. Let me know if it is still hanging for you guys and if-so, what does it say in the status bar when it does.

    • herain December 23, 2010 at 8:27 pm #

      i got error 404 on download link

      • Riyad Kalla December 23, 2010 at 9:43 pm #

        Curses! I was in a rush, just fixed all the links. Sorry about that.

    • osman December 24, 2010 at 12:30 am #

      yes it wotks, great job.


  12. herain December 24, 2010 at 2:33 am #

    sweeet it works!! 😀 is there a way to disable posting to twitter and facebook? 😀

    • Riyad Kalla December 24, 2010 at 4:14 pm #

      Glad to hear it’s working now guys — I actually like this version better, it has a smaller dependency footprint.

      As for the crossposting with twitter and facebook, I believe that is configured inside of foursquare’s profile interface somewhere — it’s a preference to update your friends on your social networks or not.

  13. stefano January 7, 2011 at 6:44 am #

    It works for me.
    But my question is:
    May I unblock badges with this?

  14. osman January 12, 2011 at 4:37 am #


    I receive following error message, is there any way to fix it?

    “API error occured: Server returned HTTP response code: 401 URL:“v1/checkin..”

    • Riyad Kalla January 12, 2011 at 8:31 am #

      osman – A 401 HTTP error is an auth error — are you forgetting to enter your login credentials for 4sq completely? Name and password?

      • osman January 12, 2011 at 8:36 am #

        yes you’re right, it’s just a password issue..


  15. Ollie January 18, 2011 at 8:40 am #

    Will this earn you badges? For example since I live in PA can I get badges that are specific to NY by checking in to places there? I tried a few it didn’t seem to give a badge even though I met the requirements for it.

    • Riyad Kalla January 21, 2011 at 8:45 am #

      Ollie one of the readers said you can earn badgets, just not Mayorships.

  16. Joop deBruin January 18, 2011 at 12:46 pm #

    Seems that 4Square changed the POST expectation.
    Getting 405 codes as of 16:00 UTC time today, January 18.

    • Joop deBruin January 18, 2011 at 3:05 pm #

      Sorry, just another one of 4Square’s many server outages. Working now.

      • Riyad Kalla January 21, 2011 at 8:50 am #

        Joop, thanks for the update. Glad it’s working again.

  17. Joop deBruin January 21, 2011 at 3:40 pm #

    Just confirmed that it isn’t registering as coming from your phone, so it doesn’t affect Mayorships, just badges.

    Anyone know what the 4Square app draws from to know that you’re using your phone?

    • Tuff February 11, 2011 at 2:20 pm #

      not working for badges either now…only good for -dry- check-in

  18. shazmir January 24, 2011 at 12:27 pm #

    help me, i got this error!

    API Error Occurred: Server returned HTTP response code: 400 for URL:

  19. Event Horizon February 21, 2011 at 9:48 am #

    Why can’t you get badges when using this hack to check-in to places?

    • Riyad Kalla February 21, 2011 at 10:22 am #


      I believe it is 4sq’s attempt at curbing fake checkins because a lot of businesses give deals (worth money) for mayorships and things along those lines, and it wouldn’t be fair if it was fake.

      • Jimmy March 9, 2011 at 12:00 pm #

        So i heard that mayorships aren’t attainable anymore with your prog is this true? Can you confirm we CANNOT receive mayorships anymore using your program.

        • Riyad Kalla March 10, 2011 at 8:32 am #


          The program uses the documented 4sq APIs to do the checkin, there isn’t any black magic. I’m also not a 4sq user, I just like writing software.

          So if they changed some policy with API checkins not counter for mayorships, then that would mean you can’t get a mayorship anymore from this hack’s checkins.

          • Mike March 10, 2011 at 8:37 am #

            They just performed a major rev to the mobile apps yesterday (to 2.0). I wouldn’t be surprised if they closed a few gaping holes (including this one) with this release.

            Anyway, thanks for the hack while it lasted!

            • Riyad Kalla March 10, 2011 at 8:41 am #

              Mike, thanks for the heads up!

              I guess I’ll have to find other things to occupy my time :)

  20. David Young March 31, 2011 at 2:23 am #

    Sir Riyad Kalla,

    Please make another program for foursqaure checkin hack that will work again!!!!

    Thank You!!!

    • Riyad Kalla April 12, 2011 at 5:16 am #

      David, I didn’t realize the existing one wasn’t working anymore… is it not working or are you asking for one that allows you to become Mayor?

      • Way April 15, 2011 at 7:59 pm #

        Hi, thanks for your program. I just downloaded it and it works. I can steal a mayor with this program.

        I believe if you add the visualization when you get the points or get the badge or steal the mayor in this program, it will be more exciting.

        Thank you.

  21. Andy May 30, 2011 at 11:33 pm #

    Hi there, great concept, just getting an “API Error Occured: Operation Timed out” msg now

    Any Ideas?

    • Riyad Kalla June 1, 2011 at 8:26 am #


      It’s possible that 4sq killed off the v1 API that this hack uses. They rolled out the v2 API a long time ago and end-of-lifed the other one, but hadn’t taken it offline. I imagine they finally killed it off OR are discouraging use some other way (lots of throttling/failed API calls).

  22. Dede July 14, 2011 at 12:51 am #

    Cooollll ! like it

  23. John Yoda July 24, 2011 at 10:05 am #

    Love this program! Thanks for making it. Is it possible to make one like this for Yelp check-ins? I’m trying to be the Duke for a couple of places on Yelp but it’s taking forever since I’m not within a 1 mile radius of the place.

    • Riyad Kalla July 25, 2011 at 7:14 am #

      John, I don’t have any plans for a Yelp check-in app at the moment.

  24. Juan C, Del Carpio August 1, 2011 at 1:19 pm #

    Hey, bro! Today the Java GUI dosen´t work I think they change the API. Some solution?
    Saludos desde Perú :)

  25. Juan C, Del Carpio August 1, 2011 at 1:59 pm #

    Sorry, they just were in maintenance :0

  26. Cappy August 3, 2011 at 6:40 am #

    It worked well for about a week, now I’m getting this error over the past couple of days:

    API Error Occurred: Server returned HTTP response code: 400 for URL: http//

    Any fix in place? Thanks so much. Awesome little app!!!

    • Juan C, Del Carpio August 3, 2011 at 7:58 am #

      Yeah! the same error. Please fix it!

  27. Juan C, Del Carpio August 3, 2011 at 8:53 am #

    Here is the problem:

  28. yenaid August 3, 2011 at 9:33 am #

    Yeah! the same error. Please fix it!

  29. John Yoda August 3, 2011 at 7:36 pm #

    it stopped working for me today too. i’m getting the same “API Error Occurred: Server returned HTTP response code: 400 for URL: http//” error the rest of you guys are getting. :(

  30. Juan C, Del Carpio August 3, 2011 at 11:11 pm #

    Riyad Kalla please help us!

  31. yenaid August 4, 2011 at 6:51 am #

    Can somebody upgrade This service to Foursquare API V2?

  32. Ceejay de Leon August 6, 2011 at 12:23 am #

    I cant use it now. Tsk.

    • Juan C, Del Carpio August 6, 2011 at 12:52 am #

      Uau I need this app! :(

  33. Riyad Kalla August 8, 2011 at 1:32 pm #


    First off I had no idea so many people were using this program :)

    Second, I have been at a security conference, when I get back in town I will look at upgrading the app to version 2 of the api and see if it can still work the same way.

    Thank you for the support everybody.

    • Cappy August 8, 2011 at 1:47 pm #

      Thanks Riyad! :-)

  34. yenaid August 8, 2011 at 2:13 pm #

    Thanx Riyad Kalla, it´s veryy important this app

  35. Riyad Kalla August 11, 2011 at 9:38 am #


    Guys, I had a look at the new v2 API and won’t be able to update this utility to work with it.

    For the technically inclined, the new API requires a unique API Key per-application (to allow 4sq to easily ban abusive or broken apps).

    Given that the primary purpose of this app was me having fun writing a GUI to a hack discovered by another developer, I don’t really want to be a dick to the 4sq team and keep pushing this forward.

    Even if I did decide to be an ass and port the utility to the v2 API, as soon as they discovered it, they would ban the API key, effectively banning all versions of the app from working and we’d all be right back here again.

    I think the hack helped motivate the FourSquare team to roll out more secure system and ultimately a better product, but I also think it is time to retire the program as it no longer has a use.

    I appreciate everyone sending in feedback over the last year to help make the app better. I had a good time working on it.

    • Ceejay August 11, 2011 at 8:30 pm #

      That was so sad. I will miss using this application. :/

      • Juan C, Del Carpio August 11, 2011 at 9:29 pm #


    • Kanavar August 13, 2011 at 2:16 am #

      Yea so sad need this app :(

  36. Mahmmoud April 16, 2012 at 3:37 am #

    What about now we cannot get the venueid as we used to do before

  37. ali veli January 1, 2013 at 9:45 am #

    thank you very much guyss


  1. How to Become Mayor for Any Place in Foursquare in 9 Perl Statements | The Buzz Media - September 15, 2010

    […] on this topic.Powered by WP Greet Box WordPress PluginUpdate #1: We have created a easy-to-use FourSquare checkin hack program you can run to checkin anywhere you like. You can download it for free […]

  2. FourSquare Mayor Checkin Program w/ Source Code | The Buzz Media « Amazing Source - September 15, 2010

    […] If you just want to download the program and run it, scroll down the Download section below. Thanks! Background A few weeks ago we wrote about Mayank. source codes – Google Blog Search […]

Leave a Reply