Hi Karen and Paul,

2 ways come to mind for me: 1) Using the database, if you have access to it. 2) 
Using the API.

For using the database, it would be the quickest and easiest provided you have 
access to it via your hosting provider. If you do and are familiar with SQL, 
something like the following would work:

SELECT * FROM archival_object WHERE root_record_id = 704 AND (level_id = 892 OR 
level_id = 890)

root_record_id is the ASpace ID for the resource you are trying to isolate. 
level_id is whether the archival object is a “item” or a “file” – in the 
example, it searches for objects with either “item” or “file” level. I use 
MySQL Workbench and it gets me the # of objects returned for a quick and easy 

For using the API, you don’t need special permissions from your hosting 
provider, so you can access the API just as easily as you would any data from 
the staff interface. This would be more involved, as you would need to write a  
script to execute, but if you’re familiar with Python or something of the like, 
it can be done. There are 2 endpoints that would seem useful for this: Get the 
list of URIs of this published resource and all published archival objects 
 or Fetch tree information for the top-level resource 
 The first endpoint would be good for getting all items that are published in a 
collection, but may include archival objects that are Series, sub-Series, etc. 
(aka not real items) and it excludes unpublished items. The second gets top 
level items, but if you have series, sub-series with children, then you would 
have to iterate through each of those to get an accurate count of every item 
(published or unpublished). Thankfully that endpoint gives you the data to 
point to those series/parents of children as precomputed waypoints, I believe, 
but it’s the more involved of the 2 endpoints to get right. Here’s an 
 when I used that endpoint to get all item counts that were greater or equal to 

Paul’s way of doing it is straightforward and easy, so if that works, then 
that’s what I would recommend.

Hope this helps,


From: archivesspace_users_group-boun...@lyralists.lyrasis.org 
<archivesspace_users_group-boun...@lyralists.lyrasis.org> On Behalf Of Paul 
Sent: Friday, September 23, 2022 10:50 AM
To: Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] [External] Collection item count?

Hi Karen,
I would also like to know how to generate a report like this, but a quick 
approach in the meantime I've used before: export the collection as EAD, and 
search level="item" (or file, or whichever else) within the resulting EAD.

On Fri, Sep 23, 2022 at 10:35 AM Karen Urbec 
<karen.ur...@whoi.edu<mailto:karen.ur...@whoi.edu>> wrote:
Hi Everyone,
I have what I thought would be a simple question, but it turns out is not so 
easy. I’m trying to get a complete item count from a collection, and I can’t 
see where that is listed or how to generate that report. I see where I can 
calculate the extent of each series, though those numbers don’t match what is 
in the series, so it’s unclear how that number is being calculated. This feels 
like such a simple question—I just want to know how many individual items are 
in a full collection, but we can’t seem to figure it out. Any help would be 
much appreciated!

Karen Urbec (she/her)
Institution Archivist, MBLWHOI Library
Data Library and 
Woods Hole Oceanographic Institution
266 Woods Hole Road, MS#8, Woods Hole, MA 02543

Archivesspace_Users_Group mailing list

Paul Sutherland (he/his)
Archivist of Indigenous Materials
Center for Native American and Indigenous Research
Library & Museum
American Philosophical Society
105 S. 5th Street, 2nd Floor
Philadelphia, PA 19406
Browse our Indigenous Subject Guide<https://indigenousguide.amphilsoc.org>
and read our latest blog posts<https://www.amphilsoc.org/blog-category/cnair>
Twitter: @paulssutherland<https://twitter.com/paulssutherland>

Becoming Weatherwise showing at the APS 
Museum<https://www.amphilsoc.org/visit-museum>, 4/8-12/30

The APS has updated its COVID 
APS buildings are open to staff and visitors, and it has expanded access to its 
Reading Room services. Please read our updated Reading Room policies on our 

I respectfully acknowledge that I work and reside in Lenapehoking, the homeland 
of the Lenape people in past, present, and future generations. I ​am grateful 
for the past and ongoing generosity of numerous Indigenous communities and 
individuals who have offered guidance, expertise, and opportunities for 
collaboration that make my work possible.
Archivesspace_Users_Group mailing list

Reply via email to