PHP code example of larowka / kudago-api

1. Go to this page and download the library: Download larowka/kudago-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

larowka / kudago-api example snippets


use Larowka\KudaGo\Api;

$kudago = new Api();

$events = $kudago->events();

// Sorting
$events->orderBy('id', '-publication_date') // Order by id ASC and by publication_date DESC
        ->get();

// Details
$events->expand('images', 'dates') // Get detailed information of images and dates in result
        ->get();

// Filter by time
$events->before('2022', '!Y')    // Get results between 2021-10-12 and 2022 year
        ->after('2021-10-12', 'Y-m-d')
        ->get();

// Filter by coordinates
$events->inRadius(59.9, 30.3, 10000) // Include only events in radius 10000 meters around point [latitude, longitude]
        ->get();

// Paginator
$events->page(3) // Page number
        ->pageSize(35) // Items on page
        ->get();
        
// Concrete object
$events->find(161043); // find by event ID

$categories = $kudago->categories();

$eventCategories = $categories->events()->get();
$placeCategories = $categories->places()->get();

$locations = $kudago->locations();

$cities = $locations->orderBy('timezone')->get();
$city = $locations->find('spb');

$kudago->search()
        ->query('art') // Query string
        ->type('event') // Include only specific type: news, event, place, list
        ->expand('place', 'dates')
        ->get();

$kudago->events()
        ->after('2021-10-11')
        ->orderBy('-publication_date')
        ->page(5)
        ->pageSize(50)
        ->get();

$kudago->eventsOfTheDay()->get();

$kudago->news()->get();

$kudago->lists()->get();

$kudago->places()
        ->ids(157,33338) // Include only specific places by placeID
        ->get();

$kudago->movies()->get();

$kudago->showings()
        ->inPlace(19757) // Include only showings in specific place
        ->get();

$kudago->movieShowings(3315)
        ->inPlace(19757) // Include only showings in specific place
        ->get();

$kudago->agents()->get();

$kudago->agentRoles()->get();