You are here

public function Locations::searchLocation in Instagram API 8

Search for a location by geographic coordinate.

Parameters

string $lat: Lat.

string $lng: Lng.

string $distance: Dist.

bool $cacheable: Cacheable.

Return value

array|bool Response array. https://api.instagram.com/v1/locations/search?lat=48.858844&lng=2.294351...

See also

https://www.instagram.com/developer/endpoints/locations/

File

src/Service/Locations.php, line 119

Class

Locations
Class Locations.

Namespace

Drupal\instagram_api\Service

Code

public function searchLocation($lat, $lng, $distance = 500, $cacheable = TRUE) {
  $response = $this->client
    ->request('locations/search', [
    'lat' => $lat,
    'lng' => $lng,
    'distance' => $distance,
  ], $cacheable);
  if ($response) {
    return $response;
  }
  return FALSE;
}