Get artifacts results page from command line



Using Ruby, I’m trying to get the content of the last artifact that is a result of a SimpleCov coverage report.

I’m able so far to retrieve the last artifact with this code (using an Access Token) :

module Ci
  class Circle
    # more code

    def artifacts
      @artifacts = self.class.get("/project/github/#{@user}/#{@project}/latest/artifacts?circle-token=#{ENV['CI_ACCESS_TOKEN']}")

    # more code

Then, I’m retrieving the index page which I want to get the content from, with this code:

def report
  artifacts = JSON.parse(@artifacts.parsed_response)
  artifacts.each do |response|
    url = response['url']
    return url if url.end_with? '.html'


I want to get the content of the coverage page, located at, but when logged out, it shows Must be log in. I’ve tried to check the CircleCI documentation but were not able to find out how to pass an access token to this page in order to get it’s content from the command line (where I’m obviously not log in). Ideas?


To make this work you can append an API token with ‘view-builds’ scope to the artifact link like so:

Generate a token on the ‘Project settings > API permissions’ screen.


@tom Thanks for your answer. I actually tried to do it but using the Api access token, not the project, which causes it to fails. Thanks again