saintx adlı üyeden alıntı: mesajı görüntüle
@Gladio28; öncelikle, mübarek Ramazan Bayramınızı en içten dileklerimle kutlarım. Sorunuza gelecek olursak, bu işlemi Google'ın sağlamış olduğu API istemcisiyle yapabilirsiniz. API istemcisine ait depoya bu bağlantıdan ulaşabilirsiniz.

Öncelikle, depoyu kurmak için işletim sisteminizde hâlihazırda Composer'ın kurulu olması gerekmektedir. Normal kurulumu tavsiye etmiyorum. Yine de, ihtiyacınız doğrultusunda normal kurulum da yapabilirsiniz. Normal kurulum için, kurulum bilgileri ilgili deponun "beni oku" dosyasında mevcuttur.

composer require google/apiclient:~1
Yukarıdaki komut ile paketi projenize dahil edebilirsiniz.

require 'vendor/autoload.php';
Daha sonra, yukarıdaki betik ile "otomatik yükleyiciyi" sayfanıza dahil edin. Artık "Google_*" önismine sahip sınıfları kolayca kullanabileceksiniz.

Örnek (YouTube üzerinde arama yapma);
<?php

$htmlBody = <<<END
<form method="GET">
  <div>
    Search Term: <input type="search" id="q" name="q" placeholder="Enter Search Term">
  </div>
  <div>
    Max Results: <input type="number" id="maxResults" name="maxResults" min="1" max="50" step="1" value="25">
  </div>
  <input type="submit" value="Search">
</form>
END;

// This code will execute if the user entered a search query in the form
// and submitted the form. Otherwise, the page displays the form above.
if ($_GET['q'] && $_GET['maxResults']) {
  // Call set_include_path() as needed to point to your client library.
require_once 'vendor/autoload.php';

  /*
   * Set $DEVELOPER_KEY to the "API key" value from the "Access" tab of the
   * {{ Google Cloud Console }} <{{ https://cloud.google.com/console }}>
   * Please ensure that you have enabled the YouTube Data API for your project.
   */
  $DEVELOPER_KEY = 'REPLACE_ME';

  $client = new Google_Client();
  $client->setDeveloperKey($DEVELOPER_KEY);

  // Define an object that will be used to make all API requests.
  $youtube = new Google_Service_YouTube($client);

  try {
    // Call the search.list method to retrieve results matching the specified
    // query term.
    $searchResponse = $youtube->search->listSearch('id,snippet', array(
      'q' => $_GET['q'],
      'maxResults' => $_GET['maxResults'],
    ));

    $videos = '';
    $channels = '';
    $playlists = '';

    // Add each result to the appropriate list, and then display the lists of
    // matching videos, channels, and playlists.
    foreach ($searchResponse['items'] as $searchResult) {
      switch ($searchResult['id']['kind']) {
        case 'youtube#video':
          $videos .= sprintf('<li>%s (%s)</li>',
              $searchResult['snippet']['title'], $searchResult['id']['videoId']);
          break;
        case 'youtube#channel':
          $channels .= sprintf('<li>%s (%s)</li>',
              $searchResult['snippet']['title'], $searchResult['id']['channelId']);
          break;
        case 'youtube#playlist':
          $playlists .= sprintf('<li>%s (%s)</li>',
              $searchResult['snippet']['title'], $searchResult['id']['playlistId']);
          break;
      }
    }

    $htmlBody .= <<<END
    <h3>Videos</h3>
    <ul>$videos</ul>
    <h3>Channels</h3>
    <ul>$channels</ul>
    <h3>Playlists</h3>
    <ul>$playlists</ul>
END;
  } catch (Google_Service_Exception $e) {
    $htmlBody .= sprintf('<p>A service error occurred: <code>%s</code></p>',
      htmlspecialchars($e->getMessage()));
  } catch (Google_Exception $e) {
    $htmlBody .= sprintf('<p>An client error occurred: <code>%s</code></p>',
      htmlspecialchars($e->getMessage()));
  }
}
?>

<!doctype html>
<html>
  <head>
    <title>YouTube Search</title>
  </head>
  <body>
    <?=$htmlBody?>
  </body>
</html>
Kaynak;
Ek olarak, kullanmak istediğiniz API'yi Google API Console üzerinden aktif etmelisiniz. Aksi takdirde birtakım hatalarla karşı karşıya kalabilirsiniz.

Saygılarımla, Ogün Karakuş
Yazdıkların için teşekkür ederim ama benim dediğim bu değildi.
Verdiğin örnek kodda istediği $DEVELOPER_KEY 'i PHP ile otomatik olarak nasıl oluşturabilirim onu araştırıyorum