This is the elasticsearch-backed portion of the OpenAlex API.
Please send all bug reports and feature requests to support@openalex.org.
- Python 3.10+
- Conda environment manager
- Elasticsearch (for local development)
-
Select Conda Environment:
- Open the project in VSCode
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on Mac) to open command palette - Type "Python: Select Interpreter" and select it
- Choose the
openalex-api
conda environment from the list
-
Install Dependencies:
conda activate openalex-api pip install -r requirements.txt
-
Run the Application:
- Option 1: Use VSCode debugger (F5) with pre-configured launch options
- Option 2: Run directly with Python:
python start_dev.py
- Option 3: Run the app module:
python -m app
-
Access the API:
- Main API: http://localhost:5000
- Documentation: http://localhost:5000/docs
- Works endpoint: http://localhost:5000/works
The application requires several environment variables for proper operation. These are pre-configured in the VSCode launch configurations for development.
# Install development dependencies
pip install -r requirements/dev.txt
# Run tests
pytest
# Run with coverage
pytest --cov=.
# Run specific test file
pytest tests/functional/test_works_standard_filters.py
# Start Redis cache
make cache-up
# Start test environment
make test-up
# View Kibana (if Elasticsearch is running)
make kibana
The application uses Gunicorn for production deployment as configured in Procfile
.