Ashcam API Documentation - IMAGE API
Get webcam images.
GET METHODS
Select set of images for a specific webcam for the previous NN days.
In this example all images in the last 7 days are returned.
order = oldestFirst | newestFirst (default)
limit = The number of images to return, 0 returns all within time range.
https://volcview.wr.usgs.gov/ashcam-api/imageApi/webcam/{WEBCAM_CODE}/{DAYS_OLD}/{ORDER}/{LIMIT}
Select set of images for a specific webcam.
In this example 100 images are returned.
order = oldestFirst | newestFirst (default)
limit = The number of images to return, 0 returns all within time range.
https://volcview.wr.usgs.gov/ashcam-api/imageApi/webcam/{WEBCAM_CODE}/{START_UNIXTIME}/{END_UNIXTIME}/{ORDER}/{LIMIT}
OR
https://volcview.wr.usgs.gov/ashcam-api/imageApi/webcam?webcamCode={WEBCAM_CODE}&startTimestamp={START_UNIXTIME}&endTimestamp={END_UNIXTIME}&order={ORDER}&limit={LIMIT}
Select all images for a specific webcam.
https://volcview.wr.usgs.gov/ashcam-api/imageApi/webcam/{WEBCAM_CODE}
Select NN recent images regardless of webcam.
https://volcview.wr.usgs.gov/ashcam-api/imageApi/recent/{LIMIT}
ADD NEW IMAGE
curl -i --header "username:USERNAME" --header "password:PASSWORD" -X POST
-F "webcamCode={WEBCAM_CODE}" -F "imageTimestamp=IMAGE_TIMESTAMP"
-F "file=@/local/path/to/image.jpg" -F "notNewest=Y|N" -F "interestingCode=N|V|U"
https://volcview.wr.usgs.gov/ashcam-api/imageApi/uploadImage
The notNewest field is optional and can be Y or N. If Y, then newest webcam image will remain
unchanged and the longer running webcam statistics generation process will be used to calculate oldest, newest
and total images for the appropriate webcam. This is intended for backfilling old images and should not be
used often. Images being loaded with this method may generate deadlock issues from the database if loaded too
quickly.
The interestingCode field is optional and can be N (no volcanic activity), V (volcanic activity)
or U (unknown). Indicates if this image displays volcanic activity or not. Values of V are not purged.
SET INTERESTING CODE
curl -i -X PUT https://volcview.wr.usgs.gov/ashcam-api/imageApi/interestingCode/{IMAGE_ID}/{INTERESTING_CODE}
OR
curl -i -X PUT https://volcview.wr.usgs.gov/ashcam-api/imageApi/interestingCode/{IMAGE_MD5}/{INTERESTING_CODE}
The INTERESTING_CODE field can be N (no volcanic activity), V (volcanic activity)
or U (unknown). Indicates if this image displays volcanic activity or not. Values of V are not purged.
The IMAGE_MD5 value can be used to set an image if it is already loaded, but the image id is not
available. The md5 value can be obtained on Linux systems using a command such as md5sum image.jpg.
GET INTERESTING IMAGES
https://volcview.wr.usgs.gov/ashcam-api/imageApi/interesting
curl -i -X GET https://volcview.wr.usgs.gov/ashcam-api/imageApi/interesting
OR
https://volcview.wr.usgs.gov/ashcam-api/imageApi/interesting/{DAYS_OLD}
curl -i -X GET https://volcview.wr.usgs.gov/ashcam-api/imageApi/interesting/{DAYS_OLD}
Returns images that have been determined to display volcanic activity. Use DAYS_OLD to limit results to more
recent images.
GET UNINTERESTING IMAGES
https://volcview.wr.usgs.gov/ashcam-api/imageApi/uninteresting/{DAYS_OLD}
curl -i -X GET https://volcview.wr.usgs.gov/ashcam-api/imageApi/uninteresting/{DAYS_OLD}
Returns images that have been determined to NOT display volcanic activity. DAYS_OLD is required and limits
results to more recent images. We expect many more images to be uninteresting than interesting.
About UNIXTIME Values
UNIXTIME values are numeric values that represent the number of seconds since the UNIX epoch, 1/1/1970 UTC.
These values do not contain time zone or daylight savings time information. Pretty much any programming
language's date object will be able to easily convert these values into a regular date object, or output them.
The current UNIX time value is 1714091742.
JavaScript is a special case, it uses miliseconds instead of seconds so values need to be multiplied or divided
by 1000.
To create a date object in JavaScript from a UNIX time use something like
"var myDate = new Date(UNIXTIME * 1000);".
And to convert that date back into a UNIX time value: "var UNIXTIME = myDate.getTime() / 1000;".