קבלת פרטי כניסה להרשאה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי להשתמש ב-YouTube Reporting API או בממשק ה-API של YouTube Analytics, נדרשים פרטי כניסה להרשאה.
מסמך זה מתאר את הסוגים השונים של פרטי כניסה להרשאה שנתמכים במסוף Google API. הוא גם מסביר איך למצוא או ליצור פרטי כניסה להרשאה לפרויקט.
יצירת הפרויקט ובחירה בשירותי API
- פותחים את הדף Credentials ב-API Console.
-
בדף אפשר ליצור שני סוגים שונים של פרטי כניסה.
עם זאת, כל השיטות ל-YouTube Reporting API
ול-YouTube Analytics API מחייבות הרשאת OAuth 2.0.
יש לפעול לפי ההוראות שבהמשך כדי ליצור פרטי כניסה מסוג OAuth 2.0.
-
OAuth 2.0: בכל פעם שהאפליקציה מבקשת נתונים פרטיים של משתמשים, היא צריכה לשלוח אסימון OAuth 2.0 יחד עם הבקשה. כדי לקבל אסימון, האפליקציה שלכם שולחת תחילה מזהה לקוח, ואולי גם סוד לקוח. אפשר ליצור פרטי כניסה של OAuth 2.0 לאפליקציות אינטרנט, לחשבונות שירות או לאפליקציות מותקנות.
מידע נוסף זמין במסמכי התיעוד של OAuth 2.0.
-
מפתחות API:
יש לכם אפשרות לכלול מפתח API בבקשה.
המפתח מזהה את הפרויקט ומספק גישה ל-API, מכסות
ודוחות.
לידיעתכם, כל השיטות ל-YouTube Reporting API ול-YouTube Analytics API מחייבות הרשאת OAuth 2.0.
לכן צריך לפעול לפי ההוראות שלמעלה כדי ליצור פרטי כניסה בפרוטוקול OAuth 2.0. אם רוצים, אפשר גם לשלוח
מפתח API, אבל זה לא חובה.
ה-API תומך בכמה סוגים של הגבלות על מפתחות API. אם מפתח ה-API
הדרוש לכם לא קיים כבר, יוצרים מפתח API במסוף על ידי לחיצה על Create credentials
> מפתח API. כדי להגביל את המפתח לפני שמשתמשים בו בסביבת הייצור, לוחצים על Restrict key ובוחרים אחת מהאפשרויות של Restrict.
כדי לשמור על האבטחה של מפתחות ה-API, מומלץ לפעול לפי השיטות המומלצות לשימוש מאובטח במפתחות API.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-21 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-08-21 (שעון UTC)."],[[["\u003cp\u003eApplications need authorization credentials to use the YouTube Reporting API or the YouTube Analytics API.\u003c/p\u003e\n"],["\u003cp\u003eThe Google API Console supports different types of credentials, but the YouTube Reporting API and YouTube Analytics API require OAuth 2.0 authorization.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 credentials, which involve a client ID and potentially a client secret, are needed for applications requesting private user data.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys can be used to identify a project and provide API access, but are not necessary for the YouTube Reporting API and the YouTube Analytics API.\u003c/p\u003e\n"],["\u003cp\u003eYou can generate OAuth 2.0 credentials for web applications, service accounts, or installed applications.\u003c/p\u003e\n"]]],["To use the YouTube Reporting or Analytics APIs, applications need authorization credentials. Navigate to the Credentials page in the Google API Console to create them. While API keys can be created and optionally used, OAuth 2.0 credentials are required for all methods in these APIs. Generate OAuth 2.0 credentials, including a client ID and secret. API keys identify your project and can be restricted for security, but are not a replacement for OAuth 2.0 tokens.\n"],null,["# Obtain authorization credentials\n\nYour application must have authorization credentials to be able to use the YouTube Reporting API or the YouTube Analytics API.\n\nThis document describes the different types of authorization credentials that the [Google API Console](https://console.cloud.google.com/) supports. It also explains how to find or create authorization credentials for your project.\n\nCreate your project and select API services\n-------------------------------------------\n\n1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n2. The page allows you to create two different types of credentials. However, all of the methods for the YouTube Reporting API and the YouTube Analytics API require OAuth 2.0 authorization. Follow the instructions below to generate OAuth 2.0 credentials.\n - **OAuth 2.0:** Whenever your application requests private user\n data, it must send an OAuth 2.0 token along with the request. Your\n application first sends a client ID and, possibly, a client secret to\n obtain a token. You can generate OAuth 2.0 credentials for web\n applications, service accounts, or installed applications.\n\n For more information, see the [OAuth 2.0 documentation](https://developers.google.com/identity/protocols/OAuth2).\n - **API keys:**\n\n You have the option of including an API key with a request.\n\n The key identifies your project and provides API access, quota, and\n reports.\n\n\n Note that all of the methods for the YouTube Reporting API and the\n YouTube Analytics API require OAuth 2.0 authorization.\n\n\n For that reason, you need to follow the instructions above for\n generating OAuth 2.0 credentials. If you want, you can also send an\n API key, but that's not necessary.\n\n The API supports several types of restrictions on API keys. If the API key that you\n need doesn't already exist, then create an API key in the Console by\n clicking **[Create credentials](https://console.cloud.google.com/apis/credentials) \\\u003e API key** . You can restrict the key before using it\n in production by clicking **Restrict key** and selecting one of the\n **Restrictions**.\n\nTo keep your API keys secure, follow the [best practices for\nsecurely using API keys](//cloud.google.com/docs/authentication/api-keys)."]]