API Reference

Complete reference documentation for all classes, functions, and modules.

Quick Navigation

Core Classes

  • STACItem - Individual satellite scenes

  • STACItemCollection - Collections of scenes

  • STACAsset - Individual data files

  • STACSearch - Search result containers

Client Classes

  • PlanetaryComputerCollections - Microsoft PC client

  • EarthSearchCollections - Element84 ES client

Utility Functions

Factory Functions

  • planetary_computer() - Create PC client

  • earth_search() - Create ES client

  • get_clients() - Get both clients

Class Hierarchy

BaseAPIClient
├── PlanetaryComputerCollections
└── EarthSearchCollections

STACAsset
STACItem
STACItemCollection
STACSearch

Usage Patterns

Basic Usage Pattern:

import open_geodata_api as ogapi

# Create client
client = ogapi.planetary_computer()

# Search for data
results = client.search(collections=['sentinel-2-l2a'])

# Work with results
items = results.get_all_items()
item = items[0]
urls = item.get_all_asset_urls()

Advanced Usage Pattern:

from open_geodata_api.utils import filter_by_cloud_cover, download_datasets

# Search and filter
results = client.search(collections=['sentinel-2-l2a'], limit=20)
items = results.get_all_items()
clear_items = filter_by_cloud_cover(items, max_cloud_cover=20)

# Download
download_results = download_datasets(clear_items, destination="./data/")

Downloadable Notebook of API References Testing:

You can download the full Jupyter notebook of API examples here;