YouTubePHP Documentation

ActivitiesApi extends AbstractApi
in package

FinalYes

This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.

What a channel has been doing: uploads, likes, playlist changes and the rest of its feed.

Reach it as $youtube->activities. Every method takes the parameters Google documents, by the same names: use named arguments for the optional ones.

Tags
link
https://developers.google.com/youtube/v3/docs/activities
since
1.0.0

Table of Contents

Properties

$youtube  : YouTube

Methods

__construct()  : mixed
list()  : PromiseInterface<string|int, ActivityListResponse>
Retrieves a list of resources, possibly filtered.
call()  : PromiseInterface<string|int, mixed>
streamed()  : PromiseInterface<string|int, ResponseStream>
Opens a server-streamed call and reads its body as it arrives.

Properties

Methods

list()

Retrieves a list of resources, possibly filtered.

public list(array<int, string>|string $part[, string|null $channelId = null ][, bool|null $home = null ][, int|null $maxResults = null ][, bool|null $mine = null ][, string|null $pageToken = null ][, DateTimeInterface|string|null $publishedAfter = null ][, DateTimeInterface|string|null $publishedBefore = null ][, string|null $regionCode = null ]) : PromiseInterface<string|int, ActivityListResponse>

Costs 1 unit of quota.

Parameters
$part : array<int, string>|string

The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.

$channelId : string|null = null
$home : bool|null = null

Deprecated.

$maxResults : int|null = null

The maxResults parameter specifies the maximum number of items that should be returned in the result set. From 0 to 50. YouTube assumes 5 when it is left out.

$mine : bool|null = null
$pageToken : string|null = null

The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.

$publishedAfter : DateTimeInterface|string|null = null
$publishedBefore : DateTimeInterface|string|null = null
$regionCode : string|null = null
Tags
link
https://developers.google.com/youtube/v3/docs/activities/list
since
1.0.0
Return values
PromiseInterface<string|int, ActivityListResponse>

call()

protected call(string $endpoint, string $method, string $path[, array<string, mixed> $query = [] ][, array<string, mixed>|JsonSerializable|null $body = null ][, string|null $returns = null ][, ?Media $media = null ][, ?string $uploadPath = null ][, bool $download = false ]) : PromiseInterface<string|int, mixed>
Parameters
$endpoint : string

The API method, e.g. liveChatMessages.list.

$method : string
$path : string
$query : array<string, mixed> = []
$body : array<string, mixed>|JsonSerializable|null = null
$returns : string|null = null

The type token the result hydrates as; null leaves it raw.

$media : ?Media = null
$uploadPath : ?string = null
$download : bool = false
Return values
PromiseInterface<string|int, mixed>

streamed()

Opens a server-streamed call and reads its body as it arrives.

protected streamed(string $endpoint, string $path, array<string, mixed> $query, string $returns) : PromiseInterface<string|int, ResponseStream>
Parameters
$endpoint : string
$path : string
$query : array<string, mixed>
$returns : string

The type token each element hydrates as.

Return values
PromiseInterface<string|int, ResponseStream>
On this page

Search results