judgelord / regulationsdotgov

a package to get data from regulations.gov
https://judgelord.github.io/regulationsdotgov/
MIT License
0 stars 0 forks source link

documentation for `get_details` functions for dockets, documents, and comments #2

Open judgelord opened 5 months ago

judgelord commented 5 months ago

Below are the fields returned when we query details on a specific document ID using

Note that the API does not return the originally supplied id, so get_details functions need to add it back in after extracting the data frame from the json.

Also, note that the API does not always return the same fields for different documents of the same type.

> names(docket_details)
[1] "displayProperties"
[2] "modifyDate"       
[3] "dkAbstract"       
[4] "agencyId"         
[5] "title"            
[6] "docketType"       
[7] "objectId"  

> names(document_details)
[1] "allowLateComments"
 [2] "paperLength"      
 [3] "paperWidth"       
 [4] "agencyId"         
 [5] "comment"          
 [6] "displayProperties"
 [7] "docketId"         
 [8] "documentType"     
 [9] "firstName"        
[10] "objectId"         
[11] "lastName"         
[12] "modifyDate"       
[13] "pageCount"        
[14] "postedDate"       
[15] "receiveDate"      
[16] "title"            
[17] "trackingNbr"      
[18] "withdrawn"        
[19] "openForComment" 

> names(comment_deatils)
[1] "commentOn"          
 [2] "commentOnDocumentId"
 [3] "duplicateComments"  
 [4] "agencyId"           
 [5] "comment"            
 [6] "displayProperties"  
 [7] "docketId"           
 [8] "documentType"       
 [9] "firstName"          
[10] "objectId"           
[11] "lastName"           
[12] "modifyDate"         
[13] "pageCount"          
[14] "postedDate"         
[15] "receiveDate"        
[16] "title"              
[17] "trackingNbr"        
[18] "withdrawn"          
[19] "openForComment" 

The API does not return the same fields for all documents; for document "OMB-2023-0001-0001", it returned 20 fields rather than 19:

> names(document_details)
 [1] "allowLateComments" 
 [2] "commentEndDate"    
 [3] "commentStartDate"  
 [4] "frDocNum"          
 [5] "paperLength"       
 [6] "paperWidth"        
 [7] "agencyId"          
 [8] "displayProperties" 
 [9] "docketId"          
[10] "documentType"      
[11] "fileFormats"       
[12] "objectId"          
[13] "modifyDate"        
[14] "originalDocumentId"
[15] "pageCount"         
[16] "postedDate"        
[17] "receiveDate"       
[18] "title"             
[19] "withdrawn"         
[20] "openForComment" 

For document "OMB-2023-0001-12471", it returned 15:

> names(document_details)
 [1] "duplicateComments" 
 [2] "agencyId"          
 [3] "displayProperties" 
 [4] "docketId"          
 [5] "documentType"      
 [6] "fileFormats"       
 [7] "objectId"          
 [8] "modifyDate"        
 [9] "originalDocumentId"
[10] "pageCount"         
[11] "postedDate"        
[12] "receiveDate"       
[13] "title"             
[14] "withdrawn"         
[15] "openForComment"    
judgelord commented 5 months ago

Note that paths for docket details cannot contain "include=attachments&"

judgelord commented 5 months ago

Interstingly, paths for comments and other documents appear to work with /comments/ or /documents/ in the path (i.e., the API returns document details when a document id is supplied, even when the path says /comments/