Python package to get venues from Foursquare API into Pandas DataFrame

Important: I do not use this anymore and is not being maintained. This post is here just as reference.

I’m working on my Capstone project for the IBM Data Science Professional Certificate Specialization on Coursera and wanted a fast and easy way to get venues around some coordinates. The way the explained in the course is fine, but I would like to have the data into a DataFrame ready to use.
I found which works fantastic, but still had to clean the result, thus this.
I developed a small package called foursquare_api_tools that returns the venues in a dataframe with several columns. You can check the package in GitHub

You can use it in Jupyter Notebooks without problems. I tested it in IBM Cloud and
Just install it using !pip install foursquare

Example of use

Import libraries

import foursquare as fs from foursquare_api_tools
import foursquare_api_tools as ft

Initialize the client

CLIENT_ID = 'YOUR_CLIENT_ID' # your Foursquare ID
CLIENT_SECRET = 'YOUR_SECRET' # your Foursquare Secret 
VERSION = '20180605' # Foursquare API version 

this example uses Userless Auth

# Construct the client object using foursquare package
client = fs.Foursquare(client_id=CLIENT_ID, client_secret=CLIENT_SECRET,

Use the function



Here is an example notebook created on

    "nbformat_minor": 1, 
    "cells": [
            "execution_count": 9, 
            "cell_type": "code", 
            "metadata": {}, 
            "outputs": [
                    "output_type": "stream", 
                    "name": "stdout", 
                    "text": "Requirement not upgraded as not directly required: foursquare in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages\nRequirement not upgraded as not directly required: requests>=2.1 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare)\nRequirement not upgraded as not directly required: six in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare)\nRequirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare)\nRequirement not upgraded as not directly required: idna<2.7,>=2.5 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare)\nRequirement not upgraded as not directly required: urllib3<1.23,>=1.21.1 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare)\nRequirement not upgraded as not directly required: certifi>=2017.4.17 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare)\nCollecting foursquare_api_tools from git+\n  Cloning to /home/dsxuser/.tmp/pip-build-ehhz4mgs/foursquare-api-tools\nRequirement not upgraded as not directly required: pandas in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare_api_tools)\nRequirement not upgraded as not directly required: foursquare in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare_api_tools)\nRequirement not upgraded as not directly required: python-dateutil>=2 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from pandas->foursquare_api_tools)\nRequirement not upgraded as not directly required: pytz>=2011k in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from pandas->foursquare_api_tools)\nRequirement not upgraded as not directly required: numpy>=1.9.0 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from pandas->foursquare_api_tools)\nRequirement not upgraded as not directly required: requests>=2.1 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare->foursquare_api_tools)\nRequirement not upgraded as not directly required: six in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from foursquare->foursquare_api_tools)\nRequirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare->foursquare_api_tools)\nRequirement not upgraded as not directly required: idna<2.7,>=2.5 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare->foursquare_api_tools)\nRequirement not upgraded as not directly required: urllib3<1.23,>=1.21.1 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare->foursquare_api_tools)\nRequirement not upgraded as not directly required: certifi>=2017.4.17 in /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages (from requests>=2.1->foursquare->foursquare_api_tools)\nInstalling collected packages: foursquare-api-tools\n  Found existing installation: foursquare-api-tools 0.1\n    Uninstalling foursquare-api-tools-0.1:\n      Successfully uninstalled foursquare-api-tools-0.1\n  Running install for foursquare-api-tools ... \u001b[?25ldone\n\u001b[?25hSuccessfully installed foursquare-api-tools-0.1\n"
            "source": "!pip install foursquare\n!pip install git+ --upgrade --force-reinstall\n\nimport foursquare as fs\n"
            "execution_count": 11, 
            "cell_type": "code", 
            "metadata": {}, 
            "outputs": [], 
            "source": "# The code was removed by Watson Studio for sharing."
            "execution_count": 12, 
            "cell_type": "code", 
            "metadata": {}, 
            "outputs": [], 
            "source": "# Construct the client object \nclient = fs.Foursquare(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, version=VERSION)"
            "execution_count": 13, 
            "cell_type": "code", 
            "metadata": {}, 
            "outputs": [
                    "execution_count": 13, 
                    "metadata": {}, 
                    "data": {
                        "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
indexAddressCategoryCityCountryLatitudeLongitudeNamePostal Code
00459 Broome StArts & Crafts StoreNew YorkUnited States40.722326-74.000994Purl Soho10013
1042 Wooster StSalon / BarbershopNew YorkUnited States40.722371-74.002562Sam Brocato Salon10013
20466 Broome StDance StudioNew YorkUnited States40.722578-74.001363Dance With Me SoHo10013
30484 Broome StDessert ShopNew YorkUnited States40.723101-74.002477MarieBelle10013
40171 Spring StTapas RestaurantNew YorkUnited States40.724800-74.002220Boqueria10012
5071 Greene StMen's StoreNew YorkUnited States40.723427-74.000742ONS Clothing10012
60494 Broome StSupermarketNew YorkUnited States40.723192-74.002775Sunrise Mart10013
70148 Spring StShoe StoreNew YorkUnited States40.724261-74.001328Dr. Martens10012
80469 Broome StWomen's StoreNew YorkUnited States40.722630-74.001511Isabel Marant10013
9035 Wooster StArt MuseumNew YorkUnited States40.722393-74.002730The Drawing Center10013
100453 Broome StMen's StoreNew YorkUnited States40.722173-74.001111SuitSupply10013
110398 W BroadwayDessert ShopNew YorkUnited States40.724523-74.002748Ladur\u00e9e10012
12028-26 Wooster StArt GalleryNew YorkUnited States40.721780-74.003170Leslie+Lohman Museum of Gay & Lesbian Art10013
13090 Thompson StItalian RestaurantNew YorkUnited States40.725223-74.002594San Carlo Osteria Piemonte10012
140512 Broome StBakeryNew YorkUnited States40.723516-74.003444Pi Greek Bakerie10013
15076 Greene St Fl 3Design StudioNew YorkUnited States40.723466-74.000606The Line \u2013 New York10012
160189 Spring StBakeryNew YorkUnited States40.725163-74.002976Dominique Ansel Bakery10012
170529 Broome StBurger JointNew YorkUnited States40.723897-74.004221Black Tap10013
180470 Broome StArt GalleryNew YorkUnited States40.722607-74.001432Eden Fine Art10013
190510 Broome StItalian RestaurantNew YorkUnited States40.723426-74.003277Aurora10013
20093 Grand StShoe StoreNew YorkUnited States40.721534-74.002109The Vans DQM General10013
210456 Broome StBoutiqueNew YorkUnited States40.722279-74.000879Henrik Vibskov10013
22073 Thompson StJapanese RestaurantNew YorkUnited States40.724566-74.002873Hirohisa10012
230149 Spring StBoutiqueNew YorkUnited States40.724372-74.001496LF Boutique10012
240399 W BroadwayCoffee ShopNew YorkUnited States40.724292-74.002120Ground Support10012
25071 Sullivan StFalafel RestaurantNew YorkUnited States40.724523-74.004088Ba'al Cafe10012
260139 Spring StBoutiqueNew YorkUnited States40.724289-74.000843CHANEL10012
27033 Greene StClothing StoreNew YorkUnited States40.721688-74.002298Acne Studios10013
280477 Broome StWomen's StoreNew YorkUnited States40.722684-74.002160Kirna Zab\u00eate10013
29015 Thompson St.Cocktail BarNew YorkUnited States40.722671-74.004812JIMMY at The James10013
70015 Mercer StClothing StoreNew YorkUnited States40.720585-74.0020773x110013
7101 York StGymNew YorkUnited States40.721128-74.005398Barry's Bootcamp TriBeCa10013
720Wooster StMexican RestaurantNew YorkUnited States40.725482-73.999950Calexico Cart10012
730160 Prince StBakeryNew YorkUnited States40.725968-74.001254Birdbath Neighborhood Green Bakery10012
740486 BroadwayWomen's StoreNew YorkUnited States40.721557-73.999712Madewell10013
750451 BroadwayFurniture / Home StoreNew YorkUnited States40.720590-74.001060CB210013
760190 Avenue of the AmericasItalian RestaurantNew YorkUnited States40.726395-74.003696Bar Ciccio Alimentari10013
770433 Broome StTea RoomNew YorkUnited States40.721451-73.999394Harney & Sons10013
780512 BroadwayClothing StoreNew YorkUnited States40.722491-73.999071AllSaints10012
790131 Sullivan StNew American RestaurantNew YorkUnited States40.726542-74.002252The Dutch10012
800454 W BroadwayCosmetics ShopNew YorkUnited States40.726182-74.000795Benefit Cosmetics10012
810131 Mercer StClothing StoreNew YorkUnited States40.724413-73.998758A.P.C.10012
820121 Greene StOptical ShopNew YorkUnited States40.725390-73.999140Warby Parker10012
830101 Prince StWatch ShopNew YorkUnited States40.724898-73.999035Shinola Soho10012
84045 Crosby StCycle StudioNew YorkUnited States40.721899-73.998717SoulCycle SoHo10012
850319 Church StCoffee ShopNew YorkUnited States40.719829-74.003854La Colombe Torrefaction10013
86050 Varick StEvent SpaceNew YorkUnited States40.720915-74.006207Spring Studios10013
870463 W BroadwayBagel ShopNew YorkUnited States40.726316-74.000357Sadelle's10012
880311 Church StAsian RestaurantNew YorkUnited States40.719759-74.003981Macao Trading Co.10013
89032 Avenue of the AmericasTheaterNew YorkUnited States40.720054-74.004339The Drama League Theater Center10013
90099 Prince StAmerican RestaurantNew YorkUnited States40.724688-73.998675Mercer Kitchen10012
910142 Mercer StSeafood RestaurantNew YorkUnited States40.724572-73.998469Lure Fishbar10012
920127 Grand StVegetarian / Vegan RestaurantNew YorkUnited States40.720545-74.000138Le Botaniste10013
930103 Prince StreetElectronics StoreNew YorkUnited States40.725058-73.999029Apple SoHo10012
94080 Spring StFrench RestaurantNew YorkUnited States40.722724-73.998170Balthazar10012
950458 W BroadwaySalon / BarbershopNew YorkUnited States40.726214-74.000616Serenity Salon10012
960155 Varick StWine BarNew YorkUnited States40.726240-74.005773City Winery10013
97031 Crosby StClothing StoreNew YorkUnited States40.720746-73.999346Saturdays Surf NYC10013
980199 Prince StFrench RestaurantNew YorkUnited States40.726790-74.002750Little Prince10012
99038 Macdougal StMediterranean RestaurantNew YorkUnited States40.727083-74.002914Shuka10012

100 rows \u00d7 9 columns

", "text/plain": " index Address Category \\\n0 0 459 Broome St Arts & Crafts Store \n1 0 42 Wooster St Salon / Barbershop \n2 0 466 Broome St Dance Studio \n3 0 484 Broome St Dessert Shop \n4 0 171 Spring St Tapas Restaurant \n5 0 71 Greene St Men's Store \n6 0 494 Broome St Supermarket \n7 0 148 Spring St Shoe Store \n8 0 469 Broome St Women's Store \n9 0 35 Wooster St Art Museum \n10 0 453 Broome St Men's Store \n11 0 398 W Broadway Dessert Shop \n12 0 28-26 Wooster St Art Gallery \n13 0 90 Thompson St Italian Restaurant \n14 0 512 Broome St Bakery \n15 0 76 Greene St Fl 3 Design Studio \n16 0 189 Spring St Bakery \n17 0 529 Broome St Burger Joint \n18 0 470 Broome St Art Gallery \n19 0 510 Broome St Italian Restaurant \n20 0 93 Grand St Shoe Store \n21 0 456 Broome St Boutique \n22 0 73 Thompson St Japanese Restaurant \n23 0 149 Spring St Boutique \n24 0 399 W Broadway Coffee Shop \n25 0 71 Sullivan St Falafel Restaurant \n26 0 139 Spring St Boutique \n27 0 33 Greene St Clothing Store \n28 0 477 Broome St Women's Store \n29 0 15 Thompson St. Cocktail Bar \n.. ... ... ... \n70 0 15 Mercer St Clothing Store \n71 0 1 York St Gym \n72 0 Wooster St Mexican Restaurant \n73 0 160 Prince St Bakery \n74 0 486 Broadway Women's Store \n75 0 451 Broadway Furniture / Home Store \n76 0 190 Avenue of the Americas Italian Restaurant \n77 0 433 Broome St Tea Room \n78 0 512 Broadway Clothing Store \n79 0 131 Sullivan St New American Restaurant \n80 0 454 W Broadway Cosmetics Shop \n81 0 131 Mercer St Clothing Store \n82 0 121 Greene St Optical Shop \n83 0 101 Prince St Watch Shop \n84 0 45 Crosby St Cycle Studio \n85 0 319 Church St Coffee Shop \n86 0 50 Varick St Event Space \n87 0 463 W Broadway Bagel Shop \n88 0 311 Church St Asian Restaurant \n89 0 32 Avenue of the Americas Theater \n90 0 99 Prince St American Restaurant \n91 0 142 Mercer St Seafood Restaurant \n92 0 127 Grand St Vegetarian / Vegan Restaurant \n93 0 103 Prince Street Electronics Store \n94 0 80 Spring St French Restaurant \n95 0 458 W Broadway Salon / Barbershop \n96 0 155 Varick St Wine Bar \n97 0 31 Crosby St Clothing Store \n98 0 199 Prince St French Restaurant \n99 0 38 Macdougal St Mediterranean Restaurant \n\n City Country Latitude Longitude \\\n0 New York United States 40.722326 -74.000994 \n1 New York United States 40.722371 -74.002562 \n2 New York United States 40.722578 -74.001363 \n3 New York United States 40.723101 -74.002477 \n4 New York United States 40.724800 -74.002220 \n5 New York United States 40.723427 -74.000742 \n6 New York United States 40.723192 -74.002775 \n7 New York United States 40.724261 -74.001328 \n8 New York United States 40.722630 -74.001511 \n9 New York United States 40.722393 -74.002730 \n10 New York United States 40.722173 -74.001111 \n11 New York United States 40.724523 -74.002748 \n12 New York United States 40.721780 -74.003170 \n13 New York United States 40.725223 -74.002594 \n14 New York United States 40.723516 -74.003444 \n15 New York United States 40.723466 -74.000606 \n16 New York United States 40.725163 -74.002976 \n17 New York United States 40.723897 -74.004221 \n18 New York United States 40.722607 -74.001432 \n19 New York United States 40.723426 -74.003277 \n20 New York United States 40.721534 -74.002109 \n21 New York United States 40.722279 -74.000879 \n22 New York United States 40.724566 -74.002873 \n23 New York United States 40.724372 -74.001496 \n24 New York United States 40.724292 -74.002120 \n25 New York United States 40.724523 -74.004088 \n26 New York United States 40.724289 -74.000843 \n27 New York United States 40.721688 -74.002298 \n28 New York United States 40.722684 -74.002160 \n29 New York United States 40.722671 -74.004812 \n.. ... ... ... ... \n70 New York United States 40.720585 -74.002077 \n71 New York United States 40.721128 -74.005398 \n72 New York United States 40.725482 -73.999950 \n73 New York United States 40.725968 -74.001254 \n74 New York United States 40.721557 -73.999712 \n75 New York United States 40.720590 -74.001060 \n76 New York United States 40.726395 -74.003696 \n77 New York United States 40.721451 -73.999394 \n78 New York United States 40.722491 -73.999071 \n79 New York United States 40.726542 -74.002252 \n80 New York United States 40.726182 -74.000795 \n81 New York United States 40.724413 -73.998758 \n82 New York United States 40.725390 -73.999140 \n83 New York United States 40.724898 -73.999035 \n84 New York United States 40.721899 -73.998717 \n85 New York United States 40.719829 -74.003854 \n86 New York United States 40.720915 -74.006207 \n87 New York United States 40.726316 -74.000357 \n88 New York United States 40.719759 -74.003981 \n89 New York United States 40.720054 -74.004339 \n90 New York United States 40.724688 -73.998675 \n91 New York United States 40.724572 -73.998469 \n92 New York United States 40.720545 -74.000138 \n93 New York United States 40.725058 -73.999029 \n94 New York United States 40.722724 -73.998170 \n95 New York United States 40.726214 -74.000616 \n96 New York United States 40.726240 -74.005773 \n97 New York United States 40.720746 -73.999346 \n98 New York United States 40.726790 -74.002750 \n99 New York United States 40.727083 -74.002914 \n\n Name Postal Code \n0 Purl Soho 10013 \n1 Sam Brocato Salon 10013 \n2 Dance With Me SoHo 10013 \n3 MarieBelle 10013 \n4 Boqueria 10012 \n5 ONS Clothing 10012 \n6 Sunrise Mart 10013 \n7 Dr. Martens 10012 \n8 Isabel Marant 10013 \n9 The Drawing Center 10013 \n10 SuitSupply 10013 \n11 Ladur\u00e9e 10012 \n12 Leslie+Lohman Museum of Gay & Lesbian Art 10013 \n13 San Carlo Osteria Piemonte 10012 \n14 Pi Greek Bakerie 10013 \n15 The Line \u2013 New York 10012 \n16 Dominique Ansel Bakery 10012 \n17 Black Tap 10013 \n18 Eden Fine Art 10013 \n19 Aurora 10013 \n20 The Vans DQM General 10013 \n21 Henrik Vibskov 10013 \n22 Hirohisa 10012 \n23 LF Boutique 10012 \n24 Ground Support 10012 \n25 Ba'al Cafe 10012 \n26 CHANEL 10012 \n27 Acne Studios 10013 \n28 Kirna Zab\u00eate 10013 \n29 JIMMY at The James 10013 \n.. ... ... \n70 3x1 10013 \n71 Barry's Bootcamp TriBeCa 10013 \n72 Calexico Cart 10012 \n73 Birdbath Neighborhood Green Bakery 10012 \n74 Madewell 10013 \n75 CB2 10013 \n76 Bar Ciccio Alimentari 10013 \n77 Harney & Sons 10013 \n78 AllSaints 10012 \n79 The Dutch 10012 \n80 Benefit Cosmetics 10012 \n81 A.P.C. 10012 \n82 Warby Parker 10012 \n83 Shinola Soho 10012 \n84 SoulCycle SoHo 10012 \n85 La Colombe Torrefaction 10013 \n86 Spring Studios 10013 \n87 Sadelle's 10012 \n88 Macao Trading Co. 10013 \n89 The Drama League Theater Center 10013 \n90 Mercer Kitchen 10012 \n91 Lure Fishbar 10012 \n92 Le Botaniste 10013 \n93 Apple SoHo 10012 \n94 Balthazar 10012 \n95 Serenity Salon 10012 \n96 City Winery 10013 \n97 Saturdays Surf NYC 10013 \n98 Little Prince 10012 \n99 Shuka 10012 \n\n[100 rows x 9 columns]" }, "output_type": "execute_result" } ], "source": "from foursquare_api_tools import foursquare_api_tools as ft\n\n#import pandas as pd\n\nft.venues_explore(client,lat='40.7233',lng='-74.0030',limit=100)" }, { "execution_count": 14, "cell_type": "code", "metadata": {}, "outputs": [ { "output_type": "stream", "name": "stdout", "text": "Help on module foursquare_api_tools.foursquare_api_tools in foursquare_api_tools:\n\nNAME\n foursquare_api_tools.foursquare_api_tools\n\nFUNCTIONS\n venues_explore(client, lat, lng, limit)\n funtion to get n-places using explore in foursquare, where n is the limit when calling the function.\n This returns a pandas dataframe with name, city ,country, lat, long, postal code, address and main category as columns\n\nFILE\n /opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/foursquare_api_tools/\n\n\n" } ], "source": "help(ft)" }, { "execution_count": 15, "cell_type": "code", "metadata": {}, "outputs": [ { "execution_count": 15, "metadata": {}, "data": { "text/plain": "['__builtins__',\n '__cached__',\n '__doc__',\n '__file__',\n '__loader__',\n '__name__',\n '__package__',\n '__spec__',\n 'pd',\n 'venues_explore']" }, "output_type": "execute_result" } ], "source": "dir(ft)" }, { "execution_count": 16, "cell_type": "code", "metadata": {}, "outputs": [ { "output_type": "stream", "name": "stdout", "text": "/opt/conda/envs/DSX-Python35/bin/python\r\n" } ], "source": "!which python" }, { "execution_count": 17, "cell_type": "code", "metadata": {}, "outputs": [ { "output_type": "stream", "name": "stdout", "text": "python: /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /opt/conda/bin/python3.6m /opt/conda/bin/python3.6-config /opt/conda/bin/python3.6m-config /opt/conda/bin/python3.6 /opt/conda/bin/python /opt/conda/envs/DSX-Python35/bin/python3.5 /opt/conda/envs/DSX-Python35/bin/python3.5m-config /opt/conda/envs/DSX-Python35/bin/python3.5-config /opt/conda/envs/DSX-Python35/bin/python3.5m /opt/conda/envs/DSX-Python35/bin/python\r\n" } ], "source": "!whereis python" }, { "execution_count": null, "cell_type": "code", "metadata": {}, "outputs": [], "source": "" } ], "metadata": { "kernelspec": { "display_name": "Python 3.5", "name": "python3", "language": "python" }, "language_info": { "mimetype": "text/x-python", "nbconvert_exporter": "python", "version": "3.5.5", "name": "python", "file_extension": ".py", "pygments_lexer": "ipython3", "codemirror_mode": { "version": 3, "name": "ipython" } } }, "nbformat": 4 }

Example output


This is the first version, and I’m using it for the project, but it can still have some bugs.
I’ll add more information and details in the future. In the meanwhile you are welcome to check the code on GitHub.


Comments powered by Disqus