API to get raw logs for a job

Hello,

  1. I saw that there is an API to get the artifacts of a given job.
  2. I also saw that from the UI I can reach the raw logs of any job and its steps.

Is there a REST API to get the raw logs of a given job (in case the developer didn’t define artifacts in his config.yml)?

Hi @ilia-cy,

You can use the following endpoint from V1.1 of our API:

https://circleci.com/api/v1.1/project/{vcs}/{account}/{project}/{job number}

An example using one of our public repositories:

https://circleci.com/api/v1.1/project/github/CircleCI-Public/android-testing-circleci-examples/241

The output for each step will then be available under the output_url key. The API only returns the link to the stored output on AWS S3, so you would then need to download the logs.

Let me know if you would like anything clarified or have any additional questions!

1 Like

That’s great, thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.