-1

I have created an app in foursquare, I have the client_id and client_secret key.By using this url https://api.foursquare.com/v2/venues/search?client_id={{client_id}}&client_secret={{client_secret}}&v={{v}}&ll=35.719307,51.490538&intent=checkin&radius=200 i got nearest place around user location .Result is :

 {
    "meta": {
        "code": 200,
        "requestId": "5e9ad1c80be7b4001c1474bb"
    },
    "response": {
        "venues": [
            {
                "id": "57650baf498e141eccfe41ea",
                "name": "اتلیه عکاسی چشمک",
                "location": {
                    "lat": 35.718884,
                    "lng": 51.49175,
                    "labeledLatLngs": [
                        {
                            "label": "display",
                            "lat": 35.718884,
                            "lng": 51.49175
                        }
                    ],
                    "distance": 119,
                    "cc": "IR",
                    "country": "ایران",
                    "formattedAddress": [
                        "ایران"
                    ]
                },
                "categories": [
                    {
                        "id": "4bf58dd8d48988d1e2931735",
                        "name": "Art Gallery",
                        "pluralName": "Art Galleries",
                        "shortName": "Art Gallery",
                        "icon": {
                            "prefix": "https://ss3.4sqi.net/img/categories_v2/arts_entertainment/artgallery_",
                            "suffix": ".png"
                        },
                        "primary": true
                    }
                ],
                "referralId": "v-1587204556",
                "hasPerk": false
            },...

I want to show venues array as a list in application and i want to show

"icon": {
    "prefix": "https://ss3.4sqi.net/img/categories_v2/arts_entertainment/artgallery_",
    "suffix": ".png"
},

in the list item but how can i show this image? I mix icon data like https://ss3.4sqi.net/img/categories_v2/arts_entertainment/artgallery_4bf58dd8d48988d1e2931735.png but i got error.

Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149

1 Answers1

1

Pieces needed to construct category icons at various sizes. Combine prefix with a size (32, 44, 64, and 88 are available) and suffix, e.g. https://foursquare.com/img/categories/food/default_64.png. To get an image with a gray background, use bg_ before the size, e.g. https://foursquare.com/img/categories_v2/food/icecream_bg_32.png

See also https://developer.foursquare.com/docs/api-reference/venues/categories/

Kosuke Ogawa
  • 7,383
  • 3
  • 31
  • 52