کد نمونه
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
با پایتون به API گرید پیش بینی دسترسی پیدا کنید:
import io
import requests
import xarray as xr
API_KEY = "AIza...(replace with your API key)"
params = {"time": "2025-05-15T20:00:00Z"}
response = requests.get(
url="https://contrails.googleapis.com/v2/grids",
params=params,
headers={"x-goog-api-key": API_KEY},
)
response.raise_for_status()
dataset = xr.load_dataset(io.BytesIO(response.content))
برای تجسم داده ها، از دفترچه یادداشت Public_Contrails_API_Tester استفاده کنید.
برای دسترسی به API منطقه پیش بینی با پایتون:
import requests
import geopandas as gpd
API_KEY = "AIza...(replace with your API key)"
params = {"time": "2025-05-15T20:00:00Z"}
response = requests.get(
url="https://contrails.googleapis.com/v2/regions",
params=params,
headers={"x-goog-api-key": API_KEY},
)
response.raise_for_status()
geodataframe = gpd.GeoDataFrame.from_features(response.json())
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-06-02 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-06-02 بهوقت ساعت هماهنگ جهانی."],[[["Access the Contrails API using Python with libraries like `requests` and `xarray` to retrieve contrail environmental impact data."],["Define parameters such as bounding box, aircraft type, and time to specify your API query."],["Utilize the provided Google API key and endpoint URL for authentication and data retrieval."],["Refer to the linked Google Colab notebook for a comprehensive example on querying the API and visualizing the data."]]],[]]