BigQuery maintains job history for jobs created in the past six months; nonetheless, you could use the 'bq ls'
to retrieve the max number of possible results (By default, you are limited to 100,000 results) , as an example, you can use the following command:
bq ls -j -n MAX_RESULTS | wc -l
This command will count the number of jobs in your project, you have to indicate the MAX_RESULTS you expect to get, the default value is 50. Once you obtain the rows you might consider to use the flag --format prettyjson
to export your results, as an example:
bq ls -j -n 1000 --format prettyjson
This command will show you the last 1000 jobs made in your project in json format.
The ls
command also could lists objects like datasets, tables, views, transfers configuration and transfers history in a collection which could be useful for you.
The Method: jobs.list lists all the jobs that you started in the specified project, the Method: jobs.get returns information about a specific job. In the links you could try those APIs, if they works as you wish you can sue it thru HTTP request or gRPC.