אנחנו מעדכנים את Data API כך שיתאים לאופן שבו YouTube סופר צפיות ב-Shorts.
מידע נוסף
קבלת פרטי כניסה להרשאה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי להשתמש ב-YouTube Data API, האפליקציה צריכה לכלול פרטי כניסה להרשאה.
מסמך זה מתאר את הסוגים השונים של פרטי כניסה להרשאה שנתמכים במסוף Google API. הוא גם מסביר איך למצוא או ליצור פרטי כניסה להרשאה לפרויקט.
יצירת הפרויקט ובחירה בשירותי API
- פותחים את הדף Credentials ב-API Console.
-
ה-API הזה תומך בשני סוגים של פרטי כניסה.
יוצרים את פרטי הכניסה המתאימים לפרויקט:
-
OAuth 2.0: בכל פעם שהאפליקציה מבקשת נתונים פרטיים של משתמשים, היא צריכה לשלוח אסימון OAuth 2.0 יחד עם הבקשה. כדי לקבל אסימון, האפליקציה שלכם שולחת תחילה מזהה לקוח, ואולי גם סוד לקוח. אפשר ליצור פרטי כניסה של OAuth 2.0 לאפליקציות אינטרנט, לחשבונות שירות או לאפליקציות מותקנות.
מידע נוסף זמין במסמכי התיעוד של OAuth 2.0.
-
מפתחות API:
בקשה שלא מספקת אסימון OAuth 2.0 חייבת לשלוח מפתח API.
המפתח מזהה את הפרויקט ומספק גישה ל-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 ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-03-06 (שעון UTC).
[null,null,["עדכון אחרון: 2024-03-06 (שעון UTC)."],[[["\u003cp\u003eApplications using the YouTube Data API require authorization credentials for access.\u003c/p\u003e\n"],["\u003cp\u003eThe Google API Console supports two types of credentials: OAuth 2.0 tokens for private user data and API keys for general API access.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 credentials can be generated for web applications, service accounts, or installed applications.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys identify your project and provide API access, quota management, and usage reports, and can be restricted in scope.\u003c/p\u003e\n"],["\u003cp\u003eYou must create the credential, either the API key or OAuth 2.0, that will fit the needs of the project.\u003c/p\u003e\n"]]],["To use the YouTube Data API, your application needs authorization credentials. You can acquire these via the Google API Console. Two types are available: OAuth 2.0 tokens for private user data, obtained using a client ID and potentially a secret, and API keys for general access, project identification, quota, and reporting. Create credentials by navigating to the console's Credentials page. API keys can be further restricted. Always refer to best practices for securely using API keys.\n"],null,["Your application must have authorization credentials to be able to use the YouTube Data 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\n1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n2. This API supports two types of credentials. Create whichever credentials are appropriate for your project:\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 A request that does not provide an OAuth 2.0 token must send an API\n key.\n\n The key identifies your project and provides API access, quota, and\n reports.\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)."]]