{"id":44255015,"url":"https://github.com/springernature/springernature_api_client","last_synced_at":"2026-02-10T16:23:48.130Z","repository":{"id":317501255,"uuid":"928833359","full_name":"springernature/springernature_api_client","owner":"springernature","description":"A Python package to interact with the Springer Nature API for fetching metadata, open access articles, and text \u0026 data mining (TDM) content.","archived":false,"fork":false,"pushed_at":"2025-11-03T07:37:42.000Z","size":138,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-03T08:25:11.919Z","etag":null,"topics":["api-wrapper","meta","metadata","openaccess","opensource","pypi","pypi-package","python3","tdm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/springernature.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-07T10:18:20.000Z","updated_at":"2025-10-24T06:39:29.000Z","dependencies_parsed_at":"2025-10-01T11:17:13.821Z","dependency_job_id":null,"html_url":"https://github.com/springernature/springernature_api_client","commit_stats":null,"previous_names":["springernature/springernature_api_client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/springernature/springernature_api_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springernature%2Fspringernature_api_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springernature%2Fspringernature_api_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springernature%2Fspringernature_api_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springernature%2Fspringernature_api_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springernature","download_url":"https://codeload.github.com/springernature/springernature_api_client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springernature%2Fspringernature_api_client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29307725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T16:09:25.305Z","status":"ssl_error","status_checked_at":"2026-02-10T16:08:52.170Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","meta","metadata","openaccess","opensource","pypi","pypi-package","python3","tdm"],"created_at":"2026-02-10T16:23:42.418Z","updated_at":"2026-02-10T16:23:48.123Z","avatar_url":"https://github.com/springernature.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Springer Nature API Client\n\n[![PyPI Version](https://img.shields.io/pypi/v/springernature_api_client)](https://pypi.org/project/springernature-api-client/)\n[![Python Version](https://img.shields.io/pypi/pyversions/springernature_api_client)](https://pypi.org/project/springernature-api-client/)\n[![License](https://img.shields.io/pypi/l/springernature_api_client)](https://github.com/springernature/springernature_api_client/blob/main/LICENSE)\n\nA Python package to interact with the **Springer Nature API** for fetching metadata, open access articles, and text \u0026 data mining (TDM) content.\n\n---\n\n## 🚀 Installation\n\n### Install Python\n\nEnsure you have Python installed (version 3.9+ recommended).\n\nWindows: Download from [python.org](https://www.python.org/downloads/) and install.\n\nmacOS: Install via Homebrew:\n\n```bash\nbrew install python\n```\n\nLinux: Install using package manager (e.g., apt for Debian/Ubuntu):\n\n```bash\nsudo apt update \u0026\u0026 sudo apt install python3 python3-venv python3-pip\n```\n\n### For Users\nTo install the package from PyPI(If you just want to use the package in your project):\n```bash\npip install springernature_api_client\n```\n\n### For Developers\nIf you're planning to contribute to the project:\n1. Install Poetry (dependency management tool)\nThis project uses Poetry for dependency management. Install Poetry if you haven't already:\n```bash\ncurl -sSL https://install.python-poetry.org | python3 -\n```\n2. Clone the repository and install dependencies\n```bash\n   git clone https://github.com/springernature/springernature_api_client.git\n   cd springernature_api_client\n   poetry install --with dev\n```\n3. Activate the virtual environment using Poetry:\n```bash\npoetry env use python\npoetry shell\n# or \npoetry env activate\n```\nSee [CONTRIBUTING.md](https://github.com/springernature/springernature_api_client/blob/main/CONTRIBUTING.md) for more details on the development workflow.\n\n## 🔑 Setup\nBefore using the package, obtain an API key from Springer Nature Developer Portal.\n\nSet the API key in your environment:\n```python\nexport SPRINGER_API_KEY=\"your_api_key_here\"\n```\nOr pass it directly in Python:\n```python\napi_key = \"your_api_key_here\"\n```\n\n## 📌 Basic Usage\n\nFetch Metadata and Export to Excel\n\n```python\nimport springernature_api_client.metadata as metadata\nfrom springernature_api_client.utils import results_to_dataframe\n\n# Initialize API Client\nmetadata_client = metadata.MetadataAPI(api_key=\"your_api_key\")\n\n# Fetch results (pagination enabled, stops at `s=200`)\nresponse = metadata_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\n\n# Convert API response to DataFrame \u0026 export to Excel\ndf = results_to_dataframe(response, export_to_excel=True, filename=\"articles.xlsx\")\n\nprint(df.head())  # Display first few rows\n```\n\n## 📚 API Modules\n\n### 1️⃣ Meta API\n\n```python\nimport springernature_api_client.meta as meta\nfrom springernature_api_client.utils import results_to_dataframe\n\nmeta_client = meta.MetaAPI(api_key=\"your_api_key\")\nresponse = meta_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\ndf = results_to_dataframe(response, export_to_excel=True)\nprint(df.head())\n```\n\n### 2️⃣ Metadata API\n\n```python\nimport springernature_api_client.metadata as metadata\nfrom springernature_api_client.utils import results_to_dataframe\n\nmetadata_client = metadata.MetadataAPI(api_key=\"your_api_key\")\nresponse = metadata_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\ndf = results_to_dataframe(response, export_to_excel=True)\nprint(df.head())\n```\n\n### 3️⃣ Open Access API\n\n```python\nimport springernature_api_client.openaccess as openaccess\nfrom springernature_api_client.utils import results_to_dataframe\n\nopenaccess_client = openaccess.OpenAccessAPI(api_key=\"your_api_key\")\nresponse = openaccess_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\ndf = results_to_dataframe(response, export_to_excel=True)\nprint(df.head())\n```\n\n### 4️⃣ TDM (Text \u0026 Data Mining) API\n\n```python\nimport springernature_api_client.tdm as tdm\n\ntdm_client = tdm.TDMAPI(api_key=\"your_api_key/your_api_metric\")\nresponse = tdm_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\nfile_path = tdm_client.save_xml(response, \"output_tdm.xml\")\nprint(f\"✅ XML saved successfully to {file_path}\")\n```\n\n### 🔄 Pagination Handling (fetch_all=True)\n\nIf fetch_all=True, the API will automatically paginate through results.\n\n```python\nresponse = metadata_client.search(q='keyword:\"cancer\"', p=20, s=1, fetch_all=False, is_premium=False)\n```\n\n## 📤 Exporting to Excel\n\nBy default, results_to_dataframe() saves the results as an Excel file:\n\n```python\ndf = results_to_dataframe(response, export_to_excel=True, filename=\"output.xlsx\")\n```\n\n## 💾 Saving XML Content (TDM API)\n\nThe TDM API save_xml() method formats and saves XML responses:\n\n```python\nfile_path = tdm_client.save_xml(xml_response, \"output_tdm.xml\")\n```\n\n## 🛠 Troubleshooting\n\n### 1️⃣ Invalid API Key\n\nEnsure you pass the correct API key.\nTry setting the API key as an environment variable.\n\n### 2️⃣ Rate Limit Exceeded (Error 429)\n\nSpringer Nature API limits requests per minute.\nIf you hit the limit, wait or request a higher quota.\n\n### 3️⃣ Connection Timeout\n\nIf requests timeout, check your internet connection.\nTry increasing the timeout value in the request.\n\n## 📄 License\n\nThis project is licensed under the MIT License. See [LICENSE](https://github.com/springernature/springernature_api_client/blob/main/LICENSE) for details.\n\n## 👨‍💻 Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](https://github.com/springernature/springernature_api_client/blob/main/CONTRIBUTING.md) for details. 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringernature%2Fspringernature_api_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringernature%2Fspringernature_api_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringernature%2Fspringernature_api_client/lists"}