# Download list of test failures

**URL:** <https://discuss.circleci.com/t/download-list-of-test-failures/52418>\
**Category:** API\
**Created:** [December 1, 2024, 1:54am UTC](https://discuss.circleci.com/t/download-list-of-test-failures/52418 "2024-12-01T01:54:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mockdeep](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mockdeep/32/24224_2.png) [@mockdeep](https://discuss.circleci.com/u/mockdeep)\
**Post date:** [December 1, 2024, 1:54am UTC](https://discuss.circleci.com/t/download-list-of-test-failures/52418/1 "2024-12-01T01:54:54Z")

</div>

I’m trying to figure out how best to programmatically get a list of test failures. Rather than needing to copy/paste test failures from the CircleCI UI, I want to be able to pull them down and automate running them locally. I’m not sure of the best way to approach this, but one thought is to download the build output and parse out the failure messages. It doesn’t appear that the CircleCI API exposes the build output in any way, however. Another thought is to upload build output as an artifact, as it does look like [the API does support downloading artifacts](https://circleci.com/docs/api/v2/index.html#tag/Job/operation/getJobArtifacts). Is there a better way to go about this?

---

<div class="post-metadata">

**Author:** ![benlaverriere](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/benlaverriere/32/35810_2.png) [@benlaverriere](https://discuss.circleci.com/u/benlaverriere)\
**Post date:** [December 5, 2024, 10:21pm UTC](https://discuss.circleci.com/t/download-list-of-test-failures/52418/2 "2024-12-05T22:21:30Z")

</div>

I’m not sure whether you’re already using `store_test_results` to upload your test results, but if so, then I agree — upload that same file using `store_artifacts` and then you’ve got a nice parseable XML file ready to fetch via API.

---

<div class="post-metadata">

**Author:** ![sebastian-lerner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sebastian-lerner/32/27833_2.png) [@sebastian-lerner](https://discuss.circleci.com/u/sebastian-lerner)\
**Post date:** [December 6, 2024, 2:05pm UTC](https://discuss.circleci.com/t/download-list-of-test-failures/52418/3 "2024-12-06T14:05:41Z")

</div>

Yeah your approach of uploading test results to an artifact and grabbing artifacts via the API would be my recommendation.
