Returns a list of available columns that can be requested in CSV generation for a specific type
.
type
possible values:award
ortransaction
{
"columns": [{
"title": "Assistance Type",
"value": "assistance_type"
},
{
"title": "Awarding Agency",
"value": "awarding_agency"
}
]
}
POST a JSON body:
{
"filters": {},
"columns": [
"award_type",
"awarding_agency_code"
]
}
filters
is a standard Search v2 JSON filter objectcolumns
is an array of column names (using thevalue
string from the/v2/download/columns
endpoint)- API should generate a CSV with columns in the same order as the array
- An empty columns array returns all available columns
{
"status":"ready",
"total_rows":null,
"file_name":"5757660_968336105_awards.zip",
"total_size":null,
"total_columns":null,
"message":null,
"url":"/Volumes/exlinux/Users/catherine/werk/dataact/usaspending-api/downloads/5757660_968336105_awards.zip",
"seconds_elapsed":null
}
-
total_size
is the estimated file size of the CSV in kilobytes, ornull
if not finished -
total_columns
is the number of columns in the CSV, ornull
if not finished -
total_rows
is the number of rows in the CSV, ornull
if not finished -
file_name
is the name of the zipfile containing CSVs that will be generated- File name is a timestamp followed by
_awards
- File name is a timestamp followed by
-
status
is a string representing the current state of the CSV generation request. Possible values are:ready
- job is ready to be runrunning
- job is currently in progressfinished
- job is completefailed
- job failed to complete
For this endpoint,
status
will always beready
, since the response is returned before generation begins -
url
- the URL for the file -
message
- a human readable error message if thestatus
isfailed
, otherwisenull
-
seconds_elapsed
is time spent generating the CSVs; alwaysnull
for this endpoint, since the response is returned before generation begins
POST a JSON body:
{
"filters": {},
"columns": [
"award_type",
"awarding_agency_code"
]
}
filters
is a standard Search v2 JSON filter objectcolumns
is an array of column names (using thevalue
string from the/v2/download/columns
endpoint)- API should generate a CSV with columns in the same order as the array
- An empty columns array returns all available columns
{
"status":"ready",
"total_rows":null,
"file_name":"5757388_622958899_transactions.zip",
"total_size":null,
"total_columns":null,
"message":null,
"url":"/Volumes/exlinux/Users/catherine/werk/dataact/usaspending-api/downloads/5757388_622958899_transactions.zip",
"seconds_elapsed":null
}
-
total_size
is the estimated file size of the CSV in kilobytes, ornull
if not finished -
total_columns
is the number of columns in the CSV, ornull
if not finished -
total_rows
is the number of rows in the CSV, ornull
if not finished -
file_name
is the name of the zipfile containing CSVs that will be generated- File name is timestamp plus
_transactions
- File name is timestamp plus
-
status
is a string representing the current state of the CSV generation request. Possible values are:ready
- job is ready to be runrunning
- job is currently in progressfinished
- job is completefailed
- job failed to complete
For this endpoint,
status
will always beready
, since the response is returned before generation begins -
url
- the URL for the file -
message
- a human readable error message if thestatus
isfailed
, otherwisenull
-
seconds_elapsed
is time spent generating the CSVs; alwaysnull
for this endpoint, since the response is returned before generation begins
Returns the current status of a download/CSV generation request.
file_name
is thefile_name
returned in thev2/download/[type]
response
{
"status":"finished",
"total_rows":3317,
"file_name":"5757388_622958899_transactions.zip",
"total_size":3334.475,
"total_columns":214,
"message":null,
"url":"/Volumes/exlinux/Users/catherine/werk/dataact/usaspending-api/downloads/5757388_622958899_transactions.zip",
"seconds_elapsed":"0.438393"
}
total_size
is the estimated file size of the CSV in kilobytes, ornull
if not finishedtotal_columns
is the number of columns in the CSV, ornull
if not finishedtotal_rows
is the number of rows in the CSV, ornull
if not finishedfile_name
is the name of the zipfile containing CSVs that will be generated- File name is timestamp followed by
_transactions
or_awards
- File name is timestamp followed by
status
is a string representing the current state of the CSV generation request. Possible values are:ready
- job is ready to be runrunning
- job is currently in progressfinished
- job is completefailed
- job failed to complete
url
- the URL for the filemessage
- a human readable error message if thestatus
isfailed
, otherwise it isnull
seconds_elapsed
is the time taken to genereate the file (ifstatus
isfinished
orfailed
), or time taken so far (ifrunning
)
We're using the
status
field on front end to decide whether or not to progress with loading the file for the user, so it may be moot - whichever you think makes the most sense for the situation.