"Ping" may not be the best word to describe what you are trying to accomplish here.You can most likely work off of whichever course ID has the highest value. In this case you would need to get the last "page" of courses to help narrow your results. Here is a PowerShell example:
USING CANVAS API:
$res = invoke-webrequest "https://school.instructure.com/api/v1/accounts/self/courses?" -method get -headers @{"Authorization" = "Bearer $auth"}
$res.headers.link
Then check the last bit of output. You should see something like
/api/v1/accounts/self/courses?page=11000&per_page=10>; rel="last"
The next step would be to make an API call on that last page.
Invoke-WebRequest "https://school.instructure.com/api/v1/accounts/self/courses?page=11000" -method get -headers @{"Authorization" = "Bearer $auth"}
THROUGH CANVAS GUI:
The other option is to run a Provisioning report for courses. When the report is finished, download it, open it in Excel, then sort the courses based on the canvas_course_id.