{"id":24711222,"url":"https://github.com/materials-consortia/optimade-gateway","last_synced_at":"2025-10-09T11:30:31.656Z","repository":{"id":37864350,"uuid":"322014976","full_name":"Materials-Consortia/optimade-gateway","owner":"Materials-Consortia","description":"A gateway for querying OPTIMADE APIs.","archived":false,"fork":false,"pushed_at":"2025-10-06T22:04:21.000Z","size":15617,"stargazers_count":6,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T00:07:48.237Z","etag":null,"topics":["databases","gateway","optimade","optimade-python"],"latest_commit_sha":null,"homepage":"https://www.optimade.org/optimade-gateway","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/Materials-Consortia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"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":"2020-12-16T14:57:11.000Z","updated_at":"2025-10-06T22:02:02.000Z","dependencies_parsed_at":"2023-10-02T06:28:05.903Z","dependency_job_id":"e6f7d16c-43c7-4a3d-9dc7-a0c028f1a75f","html_url":"https://github.com/Materials-Consortia/optimade-gateway","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Materials-Consortia/optimade-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Materials-Consortia%2Foptimade-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Materials-Consortia%2Foptimade-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Materials-Consortia%2Foptimade-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Materials-Consortia%2Foptimade-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Materials-Consortia","download_url":"https://codeload.github.com/Materials-Consortia/optimade-gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Materials-Consortia%2Foptimade-gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001300,"owners_count":26083058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["databases","gateway","optimade","optimade-python"],"created_at":"2025-01-27T07:14:16.808Z","updated_at":"2025-10-09T11:30:31.277Z","avatar_url":"https://github.com/Materials-Consortia.png","language":"Python","readme":"# OPTIMADE Gateway\n\n[![codecov](https://codecov.io/gh/Materials-Consortia/optimade-gateway/branch/main/graph/badge.svg?token=94aa7IhlUD)](https://codecov.io/gh/Materials-Consortia/optimade-gateway) [![CI Status](https://github.com/Materials-Consortia/optimade-gateway/actions/workflows/ci_tests.yml/badge.svg?branch=main)](https://github.com/Materials-Consortia/optimade-gateway/actions?query=branch%3Amain) [![Last Commit](https://img.shields.io/github/last-commit/Materials-Consortia/optimade-gateway/main?logo=github)](https://github.com/Materials-Consortia/optimade-gateway/pulse)\n\nA REST API server acting as a gateway for databases with an OPTIMADE API, handling the distribution and collection of a single query to several different OPTIMADE databases.\n\nThe design outline is available [here](docs/design.md).\n\n## Known limitations\n\nHere follows a list of known limitations and oddities of the current OPTIMADE gateway code.\n\n### Pagination\n\nPagination is a bit awkward in its current implementation state.\n\nWhen using the `page_limit` query parameter for a gateway query for gateways with multiple databases, i.e., for `GET /gateways/{gateway ID}/structures` and `GET /queries/{query ID}`, the resulting entry-resource number is the product of the `page_limit` value and the number of databases in the gateway (maximum).\nThis is because the `page_limit` query parameter is passed straight through to the external database requests, and the returned entries are stitched together for the gateway response.\n\nSo effectively, when querying `GET /gateways/{gateway with N databases}/structures?page_limit=5` the resulting (maximum) number of entries returned in the response (the size of the `data` array in the response) will be N x 5, and not 5 as would otherwise be expected.\n\nThe intention is to fix this in the future, either through short-time caching of external database responses, or figuring out if there is a usable algorithm that doesn't extend the number of external requests (and therefore the gateway response times) by too much.\n\n### Sorting\n\nSorting is supported for all the gateway's own resources, i.e., in the `/gateways`, `/databases`, and `/queries` endpoints.\nBut sorting is **not supported** for the results from external OPTIMADE databases.\nThis means the `sort` query parameter has no effect in the `GET /gateways/{gateway ID}/structures` and `GET /queries/{query ID}` endpoints.\n\nThis shortcoming is a direct result of the current `page_limit` query parameter handling, and the [limitation of the same](#pagination).\n\n## License, copyright \u0026 funding support\n\nAll code in this repository was originally written by Casper Welzel Andersen ([@CasperWA](https://github.com/CasperWA)).\nThe design for the gateway as outlined in [design.md](docs/design.md) was a joint effort between Casper Welzel Andersen \u0026 Carl Simon Adorf ([@csadorf](https://github.com/csadorf)).\n\nAll files in this repository are licensed under the [MIT license](LICENSE) with copyright \u0026copy; 2021 Casper Welzel Andersen \u0026 THEOS, EPFL.\n\n### Funding support\n\nThis work was funded by [THEOS](http://theossrv1.epfl.ch), [EPFL](https://epfl.ch) and [the MarketPlace project](https://www.the-marketplace-project.eu/).\n\nThe MarketPlace project is funded by [Horizon 2020](https://ec.europa.eu/programmes/horizon2020/) under H2020-NMBP-25-2017 call with Grant agreement number: 760173.\n\n\u003cdiv style=\"text-align:center\"\u003e\n\u003cimg src=\"docs/images/THEOS_logo.png\" alt=\"THEOS\" width=\"73\" style=\"margin:0px 12px\"/\u003e\u003cimg src=\"docs/images/EPFL_Logo_184X53.svg\" alt=\"EPFL\" width=\"120\" style=\"margin:0px 12px\"/\u003e\u003cimg src=\"docs/images/MARKETPLACE_LOGO_300dpi.png\" alt=\"The MarketPlace Project\" width=\"159\" style=\"margin:0px 12px\"/\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaterials-consortia%2Foptimade-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaterials-consortia%2Foptimade-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaterials-consortia%2Foptimade-gateway/lists"}