# @maxim_mazurok/gapi.client.youtubereporting-v1

> TypeScript typings for YouTube Reporting API v1

Latest version **0.2.20260930** (published 2026-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @maxim_mazurok/gapi.client.youtubereporting-v1
pnpm add @maxim_mazurok/gapi.client.youtubereporting-v1
yarn add @maxim_mazurok/gapi.client.youtubereporting-v1
bun add @maxim_mazurok/gapi.client.youtubereporting-v1
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.20260930 |
| Published | 2026-10-01 |
| First published | 2022-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 27.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 59 |
| Author | Maxim Mazurok |
| Maintainers | maxim_mazurok |

## Links

- npm: https://www.npmjs.com/package/@maxim_mazurok/gapi.client.youtubereporting-v1
- Repository: https://github.com/Maxim-Mazurok/google-api-typings-generator
- Homepage: https://github.com/Maxim-Mazurok/google-api-typings-generator#readme
- Issues: https://github.com/Maxim-Mazurok/google-api-typings-generator/issues
- npm.io page: https://npm.io/package/@maxim_mazurok/gapi.client.youtubereporting-v1

## Dependencies (2)

- [@types/gapi.client](https://npm.io/package/@types/gapi.client.md) *
- [@types/gapi.client.discovery-v1](https://npm.io/package/@types/gapi.client.discovery-v1.md) *

## Recent versions

- 0.2.20260930 (latest) — 2026-10-01
- 0.2.20260929 — 2026-09-30
- 0.2.20260928 — 2026-09-29
- 0.2.20260927 — 2026-09-29
- 0.2.20260915 — 2026-09-16
- 0.2.20260914 — 2026-09-15
- 0.2.20260909 — 2026-09-10
- 0.2.20260908 — 2026-09-09
- 0.2.20260907 — 2026-09-08
- 0.2.20260902 — 2026-09-03
- 0.2.20260901 — 2026-09-02
- 0.2.20260826 — 2026-08-27
- 0.2.20260825 — 2026-08-26
- 0.2.20260824 — 2026-08-25
- 0.2.20260823 — 2026-08-24
- … 623 more at https://npm.io/package/@maxim_mazurok/gapi.client.youtubereporting-v1/versions

## README

# TypeScript typings for YouTube Reporting API v1

Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.
For detailed description please check [documentation](https://developers.google.com/youtube/reporting/v1/reports/).

## Installing

Install typings for YouTube Reporting API:

```
npm install @types/gapi.client.youtubereporting-v1 --save-dev
```

## TypeScript 6.0+

TypeScript 6.0 changed `types` to default to `[]`. You must now explicitly list type packages in `tsconfig.json`:

```json
{
  "compilerOptions": {
    "types": [
      "gapi",
      "gapi.auth2",
      "gapi.client",
      "gapi.client.youtubereporting-v1"
    ]
  }
}
```

## Usage

You need to initialize Google API client in your code:

```typescript
gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});
```

Then load api client wrapper:

```typescript
gapi.client.load(
  'https://youtubereporting.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.youtubereporting
  },
);
```

```typescript
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('youtubereporting', 'v1', () => {
  // now we can use:
  // gapi.client.youtubereporting
});
```

Don't forget to authenticate your client before sending any request to resources:

```typescript
// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // View monetary and non-monetary YouTube Analytics reports for your YouTube content
    'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',

    // View YouTube Analytics reports for your YouTube content
    'https://www.googleapis.com/auth/yt-analytics.readonly',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  },
);
```

After that you can use YouTube Reporting API resources: <!-- TODO: make this work for multiple namespaces -->

```typescript
/*
Creates a job and returns it.
*/
await gapi.client.youtubereporting.jobs.create({});

/*
Deletes a job.
*/
await gapi.client.youtubereporting.jobs.delete({jobId: 'jobId'});

/*
Gets a job.
*/
await gapi.client.youtubereporting.jobs.get({jobId: 'jobId'});

/*
Lists jobs.
*/
await gapi.client.youtubereporting.jobs.list({});

/*
Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`.
*/
await gapi.client.youtubereporting.media.download({
  resourceName: 'resourceName',
});

/*
Lists report types.
*/
await gapi.client.youtubereporting.reportTypes.list({});
```

For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.youtubereporting-v1#Provenance:~:text=none-,Provenance,-Built%20and%20signed)

---
_Source: https://npm.io/package/@maxim_mazurok/gapi.client.youtubereporting-v1 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
