astroquery
Functions and classes to access online astronomical data resources
What it is and what it does
Astroquery is an astropy-affiliated package that wraps access to multiple online astronomical databases and web services into a unified Python interface. Rather than writing HTTP requests or parsing HTML manually, you import a sub-package for the service you need (SIMBAD, VizieR, NED, etc.) and call standard query methods like `query_object` or `query_region` to retrieve structured data. It handles authentication (via keyring), parsing HTML and XML responses (using beautifulsoup4 and html5lib), and returning results as astropy tables.
The package is designed for astronomers and researchers who need to programmatically fetch observational data, object catalogs, or survey results from public databases. It abstracts away the details of each service's API or web interface, letting you write portable code that works across multiple data sources. Dependencies include numpy for numerical work, requests for HTTP communication, and pyvo for Virtual Observatory protocol support.
Use it for:
- Query SIMBAD to retrieve coordinates, magnitudes, and cross-references for a named astronomical object.
- Retrieve spectroscopic or photometric data from online surveys for a region of sky defined by coordinates and radius.
- Automate batch lookups of multiple objects across different catalogs without manually visiting web interfaces.
- Integrate astronomical data retrieval into a data reduction or analysis pipeline.
- Access Virtual Observatory services programmatically for interoperable data discovery.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Astroquery provides a Python interface to query and retrieve data from online astronomical databases and web services, with sub-packages for each service like SIMBAD, VizieR, and others.
Yes. Astroquery is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is the standard tool in the Python astronomy ecosystem for programmatic access to online data. Install it if you need to query astronomical databases from Python; skip it only if you work exclusively with local data or have no need for online lookups.
Install
astroquery on PyPI
pip
pip install astroqueryuv
uv add astroquerypoetry
poetry add astroqueryInstalling astroquery
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-08-13 with regular releases; last release was 328 days ago. Depends on well-established packages (numpy, astropy, requests, beautifulsoup4) with no exotic system requirements.
License in practice
BSD license (permissive) places no restrictions on use, modification, or distribution in proprietary or academic contexts.
Quickstart
pip install astroquery
from astroquery.simbad import Simbad
result = Simbad.query_object('tet01 Ori C')
print(result)
Requires Python 3.9 or later and astropy version 5.0 or later.
Verify before relying
- Whether all available sub-packages (e.g. VizieR, NED, Gaia) are documented or discoverable in the current version.
- Performance characteristics when querying large result sets or multiple services in sequence.
- Rate-limiting or throttling policies enforced by the underlying web services.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — numpy, astropy, requests, beautifulsoup4, html5lib, keyring, pyvo |
| Maintenance | actively maintained — 328 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 431,349/month — #6,718 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: astroquery-0.4.11-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
lsst-daf-butlerProvides an abstraction layer for reading and…
unclear · top 15,000 on PyPI
pyvoPyVO provides Python access to Virtual…
permissive · top 15,000 on PyPI
specutilsSpecutils provides Python representations of…
permissive · top 15,000 on PyPI
asdf-astropyProvides ASDF serialization plugins for astropy…
unclear · top 15,000 on PyPI
regionsRegions provides tools for defining,…
permissive · top 15,000 on PyPI
astropy-healpixProvides HEALPix spherical pixelization for…
permissive · top 15,000 on PyPI
photutilsPhotutils provides tools for detecting and…
permissive · top 15,000 on PyPI
skyfield-dataProvides pre-packaged astronomical data files…
permissive · top 15,000 on PyPI
pytest-astropyA meta-package that bundles pytest plugins and…
permissive · top 15,000 on PyPI
cinemagoerCinemagoer retrieves and queries movie, actor,…
copyleft · top 15,000 on PyPI