Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention the Metadata API #268

Open
sabahfromlondon opened this issue Nov 28, 2022 · 5 comments
Open

Mention the Metadata API #268

sabahfromlondon opened this issue Nov 28, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sabahfromlondon
Copy link

Can we include all of the metadata in the registry in an API so that users can automate the process to check: last update, update frequency, last retrieved, available formats etc. to see what has changed with each of the OCDS datasets?

@sabahfromlondon sabahfromlondon added the enhancement New feature or request label Nov 28, 2022
@jpmckinney jpmckinney removed their assignment Nov 28, 2022
@jpmckinney
Copy link
Member

Yes, it's possible. It can just be a URL that returns JSON with all this metadata.

@sabahfromlondon
Copy link
Author

Dare I ask... any idea on timeframe? :)

@jpmckinney
Copy link
Member

jpmckinney commented Feb 21, 2024

We should also track metrics for the API (at minimum: datetime, requested path & query string, IP).

We can set CORS headers as well (not sure if API will be used in such context, but can't hurt).

@yolile
Copy link
Member

yolile commented Feb 21, 2024

From the PR:

@jpmckinney Also, I'm not adding this endpoint anywhere in the front end yet, so external users won't be aware of it yet. We can decide where to put it (with Sebastian, maybe) later. (That is why I'm not closing the related issue with this PR yet)

@jpmckinney
Copy link
Member

We should also track metrics for the API (at minimum: datetime, requested path & query string, IP).

rg /publications.json /var/log/apache2/other_vhosts_access.log seems fine.

We can set CORS headers as well (not sure if API will be used in such context, but can't hurt).

Done in 5e9045c


API is https://data.open-contracting.org/publications.json

Download URLs are derivable from this metadata, e.g. https://data.open-contracting.org/en/publication/{id}/download?name={year}.jsonl.gz where year is determined from date_from and date_to.

I suppose we don't always have the Excel for a given year, but the URL will respond with 404, which seems like a reasonable error for clients to handle. The alternative is to list all downloads in this (or a new) endpoint.

Sample:

  {
    "id": 68,
    "title": "OpenTender",
    "country": "Lithuania",
    "last_retrieved": "2024-10-30",
    "retrieval_frequency": "HALF_YEARLY",
    "update_frequency": "HALF_YEARLY",
    "frozen": false,
    "source_id": "lithuania_digiwhist",
    "source_url": "https://opentender.eu/lt",
    "region": "EU",
    "language": "",
    "date_from": "2006-01-01",
    "date_to": "2024-01-26"
  }

@jpmckinney jpmckinney changed the title Metadata API for Data Registry Mention the Metadata API Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants