Is there an api order_by / sort parameter in work?

It would be very useful if the "order_by" and "sort" parameters could be passed to api querystring.

"order_by" must take the following parameters: distance | registration | name

"sort" must accept the following parameters: asc | descending

The corresponding result set must have the order_by and sort parameters applied before the result set is narrowed down to the maximum results "50" that are returned.

Is it on a four-room radar or is it something that won't be offered?

We are creating an application that allows users to find the “restaurants” closest to them based on the device’s geolocation.

The problem is setting the default radius. We started by setting a radius of up to 3200 meters, hoping that this would return some results for rare locations for rent, and also return the closest results for dense locations.

This works for locations that return less than 50 because we can sort the post response, but in a dense area like Washington, DC, when there are more than 50 results, 50 that the api decides to return are NOT closest to LL.

Therefore, we must structure our query as shown below (which sucks because it requires up to 7 calls to api) in order to try to find this “sweet spot” of less than 50 results.

, " " . "" , .

ob_start();
require_once 'includes/EpiCurl.php';
require_once 'includes/EpiFoursquare.php';
$clientId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$clientSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$fsObjUnAuth = new EpiFoursquare($clientId, $clientSecret);

$time_start2 = microtime(true);

$result = $fsObjUnAuth->get('/venues/search', array(
'categoryId' => '4d4b7105d754a06374d81259',
'limit' => '50',
'radius' => '100',
'intent' => 'checkin',
'll' => $ll,
'v' => '20120211'
));
$result_count1 = count($result->response->venues);

if ($result_count1 < 30) {

    $result = $fsObjUnAuth->get('/venues/search', array(
        'categoryId' => '4d4b7105d754a06374d81259',
        'limit' => '50',
        'radius' => '200',
        'intent' => 'checkin',
        'll' => $ll,
        'v' => '20120211'
        ));

    $result_count2 = count($result->response->venues);

    if ($result_count2 < 30) {

        $result = $fsObjUnAuth->get('/venues/search', array(
            'categoryId' => '4d4b7105d754a06374d81259',
            'limit' => '50',
            'radius' => '400',
            'intent' => 'checkin',
            'll' => $ll,
            'v' => '20120211'
            ));

        $result_count3 = count($result->response->venues);

        if ($result_count3 < 30) {

            $result = $fsObjUnAuth->get('/venues/search', array(
                'categoryId' => '4d4b7105d754a06374d81259',
                'limit' => '50',
                'radius' => '800',
                'intent' => 'checkin',
                'll' => $ll,
                'v' => '20120211'
                ));
            $result_count4 = count($result->response->venues);

            if ($result_count4 < 30) {

                $result = $fsObjUnAuth->get('/venues/search', array(
                    'categoryId' => '4d4b7105d754a06374d81259',
                    'limit' => '50',
                    'radius' => '1200',
                    'intent' => 'checkin',
                    'll' => $ll,
                    'v' => '20120211'
                    ));

                $result_count5 = count($result->response->venues);

                if ($result_count5 < 30) {                
                    $result = $fsObjUnAuth->get('/venues/search', array(
                        'categoryId' => '4d4b7105d754a06374d81259',
                        'limit' => '50',
                        'radius' => '1600',
                        'intent' => 'checkin',
                        'll' => $ll,
                        'v' => '20120211'
                        ));
                    $result_count6 = count($result->response->venues);

                    if ($result_count6 < 30) {

                        $result = $fsObjUnAuth->get('/venues/search', array(
                            'categoryId' => '4d4b7105d754a06374d81259',
                            'limit' => '50',
                            'radius' => '3200',
                            'intent' => 'checkin',
                            'll' => $ll,
                            'v' => '20120211'
                            ));
                        $result_count7 = count($result->response->venues);
                    }
                }
            }
        }
    }
}
+5
1

. , , p >

"", , .

  • target = checkin , ,

  • target = , .

  • target = match , ,

+1

All Articles