A Streamlit application that fetches and compares citation metadata from Wikipedia's Citoid API and your Zotero Translator Server deployment.
- 🔍 Fetch citation metadata for any URL or DOI
- 🔬 Compare results from Citoid API and Zotero Translator Server side-by-side
- 📋 Support for multiple citation formats (Zotero, BibTeX, MediaWiki)
- ⚡ Automatic endpoint detection (search for DOIs, web for URLs)
- 📥 Download citation data as JSON or BibTeX
- ✨ Clean and intuitive user interface
- Clone this repository:
git clone <repository-url>
cd citoid-demo- Install the required dependencies:
pip install -r requirements.txt- Set up credentials (for Zotero Translator Server comparison feature):
Option A: Using Streamlit secrets (recommended for Streamlit Cloud)
cp .streamlit/secrets.toml.example .streamlit/secrets.toml
# Edit .streamlit/secrets.toml and add your credentialsOption B: Using environment variables
cp .env.example .env
# Edit .env and add your Zotero Translator Server credentialsNote: The app will work without credentials if you only use Citoid API (without comparison mode).
Run the Streamlit app:
streamlit run citation_app.pyThe app will open in your default browser at http://localhost:8501.
- Enter a URL or DOI in the text input field
- Select your preferred citation format from the dropdown
- Click the "Fetch Citation" button
- View the citation metadata
- Optionally download the results
- Enable "Comparison Mode" checkbox
- Enter a URL or DOI in the text input field
- Click the "Fetch Citation" button
- View side-by-side results from both APIs:
- Citoid API: Wikipedia's citation service
- Zotero Translator Server: Your AWS deployment
- Compare the results and download from either source
- Zotero: Comprehensive metadata format used by Zotero reference manager
- MediaWiki: Standard MediaWiki citation format
- MediaWiki Base Fields: Simplified MediaWiki format with essential fields
- BibTeX: LaTeX bibliography format
- Academic papers:
https://arxiv.org/abs/2301.00001 - News articles:
https://www.nature.com/articles/nature12373 - Substack posts:
https://kevinmunger.substack.com/p/towards-the-post-naive-internet - GitHub repositories:
https://github.com/cosmik-network/semble
10.2307/448606210.1038/nature12373
This application uses the Wikipedia Citoid API:
https://en.wikipedia.org/api/rest_v1/data/citation/{format}/{url}
The app also supports the Zotero Translator Server with two endpoints:
Search endpoint (for DOIs and other identifiers):
curl -H "x-api-key: YOUR-API-KEY" \
-H "Content-Type: text/plain" \
-d "10.2307/4486062" \
"${API_URL}/search"Web endpoint (for URLs):
curl -H "x-api-key: YOUR-API-KEY" \
-H "Content-Type: text/plain" \
-d "https://arxiv.org/abs/2301.00001" \
"${API_URL}/web"The app automatically detects whether to use /search or /web based on the input.
- Python 3.7+
- streamlit==1.29.0
- requests==2.31.0
- python-dotenv==1.0.0
You can configure credentials using either method:
Option 1: Environment Variables (.env file)
ZOTERO_API_URL: Your Zotero Translator Server API endpointZOTERO_API_KEY: API key for authentication
Option 2: Streamlit Secrets (.streamlit/secrets.toml)
cp .streamlit/secrets.toml.example .streamlit/secrets.toml
# Edit .streamlit/secrets.toml with your credentials- Push your code to GitHub
- Go to Streamlit Cloud
- Deploy your app from the GitHub repository
- In the app dashboard, go to Settings > Secrets
- Add your secrets in TOML format:
[zotero]
api_url = "https://your-api-gateway-url.execute-api.region.amazonaws.com/prod"
api_key = "your-api-key-here"- Save and your app will automatically restart with the new secrets
For more information, see Streamlit Secrets Management Documentation.