Method: ampUrls.batchGet
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
HTTP অনুরোধ
POST https://acceleratedmobilepageurl.googleapis.com/v1/ampUrls:batchGet
URL Google API HTTP টীকা সিনট্যাক্স ব্যবহার করে।
শরীরের অনুরোধ
অনুরোধের অংশে নিম্নলিখিত কাঠামো সহ ডেটা রয়েছে:
JSON প্রতিনিধিত্ব |
---|
{
"urls": [
string
]
"lookupStrategy": enum(LookupStrategy),
} |
ক্ষেত্র |
---|
urls[] | string পেয়ার করা এএমপি ইউআরএল খোঁজার জন্য ইউআরএলের তালিকা। URLগুলি কেস-সংবেদনশীল৷ প্রতি লুকআপে 50টি ইউআরএল পর্যন্ত ( ব্যবহারের সীমা দেখুন)। |
lookupStrategy | enum( LookupStrategy ) লুকআপ স্ট্র্যাটেজি অনুরোধ করা হচ্ছে। |
প্রতিক্রিয়া শরীর
সফল হলে, প্রতিক্রিয়া বডিতে নিম্নলিখিত কাঠামো সহ ডেটা থাকে:
ব্যাচ এএমপি ইউআরএল প্রতিক্রিয়া।
JSON প্রতিনিধিত্ব |
---|
{
"ampUrls": [
{
object(AmpUrl)
}
],
"urlErrors": [
{
object(AmpUrlError)
}
],
} |
ক্ষেত্র |
---|
ampUrls[] | object( AmpUrl ) BatchAmpUrlsRequest-এ প্রতিটি URL-এর জন্য, URL প্রতিক্রিয়া৷ প্রতিক্রিয়া ব্যাচ অনুরোধের URL-এর মতো একই ক্রমে নাও হতে পারে। যদি BatchAmpUrlsRequest-এ ডুপ্লিকেট URL থাকে, AmpUrl শুধুমাত্র একবার তৈরি হয়। |
urlErrors[] | object( AmpUrlError ) অনুরোধ করা ইউআরএলের ত্রুটি যার কোনো এএমপি ইউআরএল নেই। |
লুকআপ স্ট্র্যাটেজি
এনামস |
---|
FETCH_LIVE_DOC | FETCH_LIVE_DOC কৌশল সূচীতে পাওয়া যায় না এমন URLগুলির লাইভ নথি নিয়ে আসা জড়িত৷ সূচীতে না পাওয়া যেকোন অনুরোধের ইউআরএল রিয়েলটাইমে ক্রল করা হয় যাতে সংশ্লিষ্ট এএমপি ইউআরএল থাকে কিনা তা যাচাই করতে। এই কৌশলটির উচ্চতর কভারেজ রয়েছে তবে রিয়েলটাইম ক্রলিং দ্বারা প্রবর্তিত অতিরিক্ত বিলম্ব সহ। এটি ডিফল্ট কৌশল। এই কৌশল ব্যবহার করে অ্যাপ্লিকেশনগুলিকে API কলগুলির উচ্চ HTTP টাইমআউট সেট করা উচিত। |
IN_INDEX_DOC | IN_INDEX_DOC কৌশলটি সূচীতে পাওয়া যায় না এমন URL(গুলি) এর লাইভ নথিগুলি আনা থেকে বিরত থাকে৷ যেসব অ্যাপ্লিকেশনের জন্য IN_INDEX_DOC কৌশল কম লেটেন্সি ব্যবহার করার পরামর্শ দেওয়া হয়। |
AmpUrl
অনুরোধ করা ইউআরএলের জন্য এএমপি ইউআরএল প্রতিক্রিয়া।
JSON প্রতিনিধিত্ব |
---|
{
"originalUrl": string,
"ampUrl": string,
"cdnAmpUrl": string,
} |
ক্ষেত্র |
---|
originalUrl | string আসল নন-এএমপি ইউআরএল। |
ampUrl | string AMP URL প্রকাশকের ওয়েব সার্ভারের দিকে নির্দেশ করে। |
cdnAmpUrl | string এএমপি ক্যাশে ইউআরএলটি Google এএমপি ক্যাশে ক্যাশ করা ডকুমেন্টের দিকে নির্দেশ করে। |
AmpUrlError
একটি অনুরোধ করা URL এর জন্য AMP URL ত্রুটি সংস্থান যা খুঁজে পাওয়া যায়নি৷
JSON প্রতিনিধিত্ব |
---|
{
"errorCode": enum(ErrorCode),
"errorMessage": string,
"originalUrl": string,
} |
ক্ষেত্র |
---|
errorCode | enum( ErrorCode ) একটি API কলের ত্রুটি কোড। |
errorMessage | string একটি ঐচ্ছিক বর্ণনামূলক ত্রুটি বার্তা। |
originalUrl | string আসল নন-এএমপি ইউআরএল। |
ভুল সংকেত
একটি ব্যাচ এএমপি ইউআরএল লুকআপের জন্য ত্রুটি কোড।
এনামস |
---|
ERROR_CODE_UNSPECIFIED | নির্দিষ্ট ত্রুটি নেই. |
INPUT_URL_NOT_FOUND | ইঙ্গিত করে যে অনুরোধ করা URLটি সূচীতে পাওয়া যাচ্ছে না, সম্ভবত এটি খুঁজে পাওয়া যাচ্ছে না, Googlebot দ্বারা অ্যাক্সেস করা যাচ্ছে না, বা অন্য কোনও ত্রুটি। |
NO_AMP_URL | ইঙ্গিত করে যে অনুরোধ করা URL-এর সাথে সামঞ্জস্যপূর্ণ কোনো AMP URL পাওয়া যায়নি৷ |
APPLICATION_ERROR | সার্ভারে কিছু ধরনের অ্যাপ্লিকেশন ত্রুটি দেখা দেয়। ক্লায়েন্টকে আবার চেষ্টা করার পরামর্শ দেওয়া হয়েছে। |
URL_IS_VALID_AMP | বর্জন করা হয়েছে: অনুরোধ করা URLটি একটি বৈধ AMP URL নির্দেশ করে৷ এটি একটি অ-ত্রুটি অবস্থা, সাফল্য বা ব্যর্থতার চিহ্ন হিসাবে নির্ভর করা উচিত নয়। এপিআই এর ভবিষ্যত সংস্করণে এটি সরানো হবে। |
URL_IS_INVALID_AMP | নির্দেশ করে যে একটি এএমপি ইউআরএল পাওয়া গেছে যেটি অনুরোধের ইউআরএলের সাথে মিলে যায়, কিন্তু এটি বৈধ AMP HTML নয়। |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2023-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2023-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eReturns AMP URLs and their corresponding AMP Cache URLs for given input URLs.\u003c/p\u003e\n"],["\u003cp\u003eUses a batch request containing up to 50 URLs and a lookup strategy (FETCH_LIVE_DOC or IN_INDEX_DOC).\u003c/p\u003e\n"],["\u003cp\u003eThe response includes the AMP URL and AMP Cache URL for successful lookups and error details for unsuccessful ones.\u003c/p\u003e\n"],["\u003cp\u003ePossible error codes include URL not found, no corresponding AMP URL, application error, and invalid AMP HTML.\u003c/p\u003e\n"],["\u003cp\u003eLeverages the Google AMP Cache for faster delivery of AMP content.\u003c/p\u003e\n"]]],["This API facilitates retrieving AMP URLs and their corresponding Google AMP Cache URLs. It uses a `POST` request to `ampUrls:batchGet`, taking a list of up to 50 URLs and a `lookupStrategy` (either `FETCH_LIVE_DOC` or `IN_INDEX_DOC`) in the request body. The response contains an array of `ampUrls` (with original, AMP, and cache URLs) and `urlErrors` (with error codes and messages). Error codes are specified for issues like \"URL not found\" and \"no AMP URL found.\"\n"],null,["# Method: ampUrls.batchGet\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchGetAmpUrlsResponse.SCHEMA_REPRESENTATION)\n- [LookupStrategy](#LookupStrategy)\n- [AmpUrl](#AmpUrl)\n - [JSON representation](#AmpUrl.SCHEMA_REPRESENTATION)\n- [AmpUrlError](#AmpUrlError)\n - [JSON representation](#AmpUrlError.SCHEMA_REPRESENTATION)\n- [ErrorCode](#ErrorCode)\n- [Try it!](#try-it)\n\nReturns AMP URL(s) and equivalent [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).\n\n### HTTP request\n\n`POST https://acceleratedmobilepageurl.googleapis.com/v1/ampUrls:batchGet`\n\nThe URL uses [Google API HTTP annotation](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|--------------------------------------------------------------------------------|---|\n| ```gdscript { \"urls\": [ string ] \"lookupStrategy\": enum(LookupStrategy), } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `urls[]` | `string` List of URLs to look up for the paired AMP URLs. The URLs are case-sensitive. Up to 50 URLs per lookup (see [Usage Limits](/amp/cache/reference/limits)). |\n| `lookupStrategy` | `enum(`[LookupStrategy](/amp/cache/reference/acceleratedmobilepageurl/rest/v1/ampUrls/batchGet#LookupStrategy)`)` The lookupStrategy being requested. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nBatch AMP URL response.\n\n| JSON representation ||\n|----------------------------------------------------------------------------------------------|---|\n| ```text { \"ampUrls\": [ { object(AmpUrl) } ], \"urlErrors\": [ { object(AmpUrlError) } ], } ``` |\n\n| Fields ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ampUrls[]` | `object(`[AmpUrl](/amp/cache/reference/acceleratedmobilepageurl/rest/v1/ampUrls/batchGet#AmpUrl)`)` For each URL in BatchAmpUrlsRequest, the URL response. The response might not be in the same order as URLs in the batch request. If BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated only once. |\n| `urlErrors[]` | `object(`[AmpUrlError](/amp/cache/reference/acceleratedmobilepageurl/rest/v1/ampUrls/batchGet#AmpUrlError)`)` The errors for requested URLs that have no AMP URL. |\n\nLookupStrategy\n--------------\n\n| Enums ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `FETCH_LIVE_DOC` | FETCH_LIVE_DOC strategy involves live document fetch of URLs not found in the index. Any request URL not found in the index is crawled in realtime to validate if there is a corresponding AMP URL. This strategy has higher coverage but with extra latency introduced by realtime crawling. This is the default strategy. Applications using this strategy should set higher HTTP timeouts of the API calls. |\n| `IN_INDEX_DOC` | IN_INDEX_DOC strategy skips fetching live documents of URL(s) not found in index. For applications which need low latency use of IN_INDEX_DOC strategy is recommended. |\n\nAmpUrl\n------\n\nAMP URL response for a requested URL.\n\n| JSON representation ||\n|-------------------------------------------------------------------------------|---|\n| ```text { \"originalUrl\": string, \"ampUrl\": string, \"cdnAmpUrl\": string, } ``` |\n\n| Fields ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `originalUrl` | `string` The original non-AMP URL. |\n| `ampUrl` | `string` The AMP URL pointing to the publisher's web server. |\n| `cdnAmpUrl` | `string` The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to the cached document in the Google AMP Cache. |\n\nAmpUrlError\n-----------\n\nAMP URL Error resource for a requested URL that couldn't be found.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------|---|\n| ```gdscript { \"errorCode\": enum(ErrorCode), \"errorMessage\": string, \"originalUrl\": string, } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | `enum(`[ErrorCode](/amp/cache/reference/acceleratedmobilepageurl/rest/v1/ampUrls/batchGet#ErrorCode)`)` The error code of an API call. |\n| `errorMessage` | `string` An optional descriptive error message. |\n| `originalUrl` | `string` The original non-AMP URL. |\n\nErrorCode\n---------\n\nError codes for a batch AMP URL lookup.\n\n| Enums ||\n|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ERROR_CODE_UNSPECIFIED` | Not specified error. |\n| `INPUT_URL_NOT_FOUND` | Indicates the requested URL is not found in the index, possibly because it's unable to be found, not able to be accessed by Googlebot, or some other error. |\n| `NO_AMP_URL` | Indicates no AMP URL has been found that corresponds to the requested URL. |\n| `APPLICATION_ERROR` | Indicates some kind of application error occurred at the server. Client advised to retry. |\n| `URL_IS_VALID_AMP` | DEPRECATED: Indicates the requested URL is a valid AMP URL. This is a non-error state, should not be relied upon as a sign of success or failure. It will be removed in future versions of the API. |\n| `URL_IS_INVALID_AMP` | Indicates that an AMP URL has been found that corresponds to the request URL, but it is not valid AMP HTML. |\n\nTry it!\n-------"]]