Thông báo lỗi trong API tĩnh của Chế độ xem đường phố
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
API tĩnh của Chế độ xem đường phố có thể đưa ra lỗi hoặc cảnh báo khi có sự cố. Hướng dẫn này giải thích từng thông báo lỗi và cung cấp thêm các hướng dẫn khác để khắc phục lỗi.
Số yêu cầu không hợp lệ
Trong trường hợp yêu cầu không hợp lệ, API tĩnh của Chế độ xem đường phố sẽ trả về mã trạng thái HTTP 4xx và một thông báo mô tả vấn đề. Dưới đây là ví dụ về các điều kiện lỗi như vậy. Lưu ý: Đây không phải là danh sách đầy đủ các lỗi có thể xảy ra. Vui lòng kiểm tra mã lỗi thực tế và thông báo mà API trả về để biết thông tin chi tiết về các vấn đề cụ thể.
Ví dụ về điều kiện lỗi
Mã trạng thái
Yêu cầu có một thông số không hợp lệ hoặc thiếu một thông số bắt buộc. Ví dụ: tham số size không nằm trong phạm vi giá trị số dự kiến hoặc bị thiếu trong yêu cầu.
400 BAD REQUEST
Khoá API trong yêu cầu không hợp lệ.
403 FORBIDDEN
Lỗi ngăn hiển thị hình ảnh trong chế độ xem đường phố
Nếu yêu cầu hợp lệ, nhưng một lỗi khác xảy ra ngăn cản việc hiển thị hình ảnh trong chế độ xem đường phố, thì API tĩnh của Chế độ xem đường phố sẽ trả về văn bản hoặc hình ảnh lỗi thay vì hình ảnh chế độ xem đường phố, tuỳ thuộc vào lỗi. Ví dụ về tình trạng lỗi như vậy là khi ứng dụng vượt quá giới hạn sử dụng.
Hình: Một hình ảnh lỗi xuất hiện thay vì hình ảnh trong chế độ xem đường phố
Lỗi liên quan đến khoá API và việc thanh toán
Nếu bạn sử dụng API tĩnh của Chế độ xem đường phố mà không có khoá API hoặc nếu tính năng thanh toán không được bật trong tài khoản của bạn, thì trang sẽ hiển thị hình ảnh lỗi thay vì hình ảnh Chế độ xem đường phố kèm theo đường liên kết cho biết loại lỗi. Ví dụ: "g.co/streetviewerror/key".
Lỗi không dùng chìa khoá và giải pháp
Bạn đang sử dụng API tĩnh của Chế độ xem đường phố mà không có khoá API. Để giải quyết, bạn phải:
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eThis guide explains error messages returned by the Street View Static API and provides instructions for resolving them.\u003c/p\u003e\n"],["\u003cp\u003eInvalid requests result in a \u003ccode\u003e4xx\u003c/code\u003e status code with a descriptive message, such as errors related to parameters or invalid API keys.\u003c/p\u003e\n"],["\u003cp\u003eWhen a valid request cannot display a street view image due to issues like usage limits, either text or an error image is returned.\u003c/p\u003e\n"],["\u003cp\u003eUsing the API without a key or billing enabled leads to an error image with a link to further information and solutions.\u003c/p\u003e\n"]]],[],null,["# Error Messages in Street View Static API\n\nThe Street View Static API may issue an error or warning when something goes\nwrong. This guide explains each error message, and provides further\ninstructions for resolving errors.\n\nInvalid requests\n----------------\n\nIn the case of an invalid request, the Street View Static API returns\nan HTTP `4xx` status code and a message describing the\nproblem. Below are examples of such error conditions. Note: This is not\na complete list of the possible errors. Please check the actual error code\nand message returned by the API for details of specific problems.\n\n| Example of error condition | Status code |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|\n| The request includes an invalid parameter, or a required parameter is missing. For example, the `size` parameter is not within the expected range of numeric values, or is missing from the request. | `400 BAD REQUEST` |\n| The API key included in the request is invalid. | `403 FORBIDDEN` |\n\nErrors that prevent a street view image from being displayed\n------------------------------------------------------------\n\nIf the request is valid, but another error occurs that prevents the street view image from\nbeing displayed, the Street View Static API returns either text or an error\nimage instead of the street view image, depending on the error. An example of such an error\ncondition is when the application exceeds its\n[usage limits](/maps/documentation/streetview/usage-limits).\n\nFigure: An error image displayed instead of a street view image\n\n### Errors related to API keys and billing\n\nIf you use the Street View Static API without an API key, or if billing\nis not enabled on your account, the page displays an error image instead of a\nstreet view image, with a link indicating the type of error. For example\n\"g.co/streetviewerror/key\".\n\n| Keyless errors and solutions ||\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | You are using the Street View Static API without an API key. To resolve, you must: 1. [Get an API key](/maps/documentation/streetview/get-api-key#get-an-api-key) 2. [Enable billing](https://console.cloud.google.com/project/_/billing/enable?utm_source=Docs_BillingNudge) 3. [Sign your URL](/maps/documentation/streetview/get-api-key#digital-signature) |\n| | Your request is missing a digital signature (required). To resolve, [Sign your URL](/maps/documentation/streetview/get-api-key#digital-signature) |"]]