How can I search for URLs or specific content across all courses?

Jump to solution
labrewster
Community Novice

Is there an API or other useful method that can be used for mass exporting all courses from a term, semester, or year? I'll mention the Canvas Community as well to see if anyone out there might know the best solution.

Thanks!

Labels (2)
1 Solution
mcarruth
Community Contributor

 @labrewster  

This information is also available in Canvas Data.  You can query inside the assignment_dim, discussion_entry_dim, discussion_topic_dim, wiki_page_dim, and for ExternalUrl in module_item_dim.  Searching CanvasData is much faster that crawling through every course with the API

below are some the queries I used to fine all the lynda.com URLs in our instance of Canvas.

##assigments
select cd.canvas_id, cd.name, ad.title, ad.description from assignment_dim ad
join course_dim cd on cd.id=ad.course_id
where ad.description like '%lynda.com%' and (cd.name like 'MASTER%' or cd.name like'WORKING%');


##pages
select cd.canvas_id, cd.name, wpd.title, wpd.body from wiki_page_dim wpd
join wiki_page_fact wpf on wpf.wiki_page_id=wpd.id
join course_dim cd on cd.id=wpf.parent_course_id
WHERE wpd.body like '%lynda.com%' and (cd.name like 'MASTER%' or cd.name like'WORKING%');

##Discussion
SELECT cd.canvas_id, cd.name, dtd.title, dtd.message FROM discussion_topic_dim dtd
JOIN discussion_topic_fact dtf on dtf.discussion_topic_id=dtd.id
join course_dim cd on cd.id=dtf.course_id
where message like '%www.lynda.com%' and (cd.name like 'MASTER%' or cd.name like'WORKING%') ;

##ExternalURL
SELECT cd.canvas_id, cd.name, mid.title, mid.url FROM module_item_dim mid
JOIN course_dim cd on cd.id=mid.course_id
where mid.url like '%www.lynda.com%' and (cd.name like 'MASTER%' or cd.name like'WORKING%') ;

View solution in original post