Add GET endpoint for retrieving basic VegBank stats#307
Merged
Conversation
RWShelton
approved these changes
Feb 10, 2026
Contributor
RWShelton
left a comment
There was a problem hiding this comment.
Structure looks good from my point of view, if this has all the fields the front end needs I'd say its good to go.
DarianGill
approved these changes
Feb 11, 2026
DarianGill
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks for adding the latest N projects!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR adds a
GET /overviewendpoint that queries VegBank for some basic stats, largely mirroring what the original VegBank site reported:Note that this is somewhat simplistic and brute force insofar as it just does a bunch of separate queries and then collects the results into a JSON object, but the driving priority is to stand up a functional endpoint for the web UI to use.
Why
Mostly so we can throw this onto the main landing (overview) page of the web app, but also so that clients can get some basic insights into VegBank holdings with a single API call.
How
Documentation and tested
Demo
$ http GET 'http://127.0.0.1:8080/overview?limit=2'{ "core_counts": [ { "count": 116352, "name": "Observations" }, { "count": 95318, "name": "Classified observations" }, { "count": 30436, "name": "NVC classified observations" }, { "count": 293172, "name": "Plants" }, { "count": 97024, "name": "Accepted USDA plants" }, { "count": 9405, "name": "Observed accepted USDA plants" }, { "count": 38981, "name": "Communities" }, { "count": 10711, "name": "Accepted US NVC communities" }, { "count": 1912, "name": "Observed accepted US NVC communities" } ], "latest_n_projects": [ { "last_date_added": "Thu, 30 Apr 2020 16:17:56 GMT", "name": "NVC Plot Template Import NCCN_plus_External_Sources_Plot_Data", "count": 3538, "pj_code": "pj.11129" }, { "last_date_added": "Wed, 25 Apr 2018 18:39:54 GMT", "name": "Canadian Transect_Grizelle Gonzalez (Gonzalez et al. 2000)", "count": 113, "pj_code": "pj.11111" } ], "top_n_community_concepts": [ { "cc_code": "cc.30623", "count": 1961, "name": "Artemisia tridentata ssp. wyomingensis Shrubland Alliance" }, { "cc_code": "cc.30769", "count": 1696, "name": "Pinus ponderosa Woodland Alliance" } ], "top_n_contributors": [ { "count": 10283, "name": "Peet, Robert", "py_code": "py.191310" }, { "count": 8657, "name": "Jennings, Michael", "py_code": "py.415" } ], "top_n_named_places": [ { "count": 16492, "name": "Nevada", "np_code": "np.395" }, { "count": 12808, "name": "California", "np_code": "np.366" } ], "top_n_plant_concepts": [ { "count": 7475, "name": "Pseudotsuga menziesii (Mirbel) Franco", "pc_code": "pc.47659" }, { "count": 7073, "name": "Acer rubrum", "pc_code": "pc.110065" } ], "top_n_projects": [ { "count": 17326, "name": "Southwest GAP, Nevada", "pj_code": "pj.10510" }, { "count": 12962, "name": "Composition and function of vegetation alliances in the Interior Northwest, USA", "pj_code": "pj.339" } ] }