# Identify xblocks used on specific pages

**URL:** <https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192>\
**Category:** Development\
**Created:** [December 2, 2021, 6:05pm UTC](https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192 "2021-12-02T18:05:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeh1239](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@mikeh1239](https://discuss.openedx.org/u/mikeh1239)\
**Post date:** [December 2, 2021, 6:05pm UTC](https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192/1 "2021-12-02T18:05:04Z")

</div>

I am trying to determine whether it is possible to identify the individual xblocks used on specific unit pages. The use cases are things like determining whether a specific xblock has actually been used before pushing updates of that xblock, identifying which xblocks exist on a unit page seen by a student, etc.

So far, my technical team has not found a way to do this. I’m hoping someone here has solved similar problems.

---

<div class="post-metadata">

**Author:** ![braden](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/braden/32/46_2.png) [@braden](https://discuss.openedx.org/u/braden)\
**Post date:** [December 3, 2021, 9:28pm UTC](https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192/2 "2021-12-03T21:28:40Z")

</div>

Hi @mikeh1239

The course blocks API should do what you want.

For example, on devstack you can use `http://localhost:18000/api/courses/v1/blocks/?course_id=course-v1:edX%2BDemoX%2BDemo_Course&username=staff&depth=all` to get all the blocks in a course. (To use this API on another server, you’ll need to change the domain name, course ID, and username).

The entries will look like this:

```auto
"block-v1:OpenCraft+onboarding+course+type@html+block@open_edx_devstack_introduction_1":{
   "id":"block-v1:OpenCraft+onboarding+course+type@html+block@open_edx_devstack_introduction_1",
   "block_id":"open_edx_devstack_introduction_1",
   "lms_web_url":"https://courses.opencraft.com/courses/course-v1:OpenCraft+onboarding+course/jump_to/block-v1:OpenCraft+onboarding+course+type@html+block@open_edx_devstack_introduction_1",
   "student_view_url":"https://courses.opencraft.com/xblock/block-v1:OpenCraft+onboarding+course+type@html+block@open_edx_devstack_introduction_1",
   "type":"html",
   "display_name":"Text"
}

```

What you want is `"type": "html"` - this indicates the type of each XBlock, and the entire response will let you quickly scan to check the types of all XBlocks in the course.

If you only want to check the blocks used on a single unit, get the unit’s ID (which should include `vertical`) then use this similar API:

`https://yourlms.com/api/courses/v1/blocks/block-v1:org+course+run+type@vertical+block@block_id/?username=your_username&depth=all`

The response format is the same, but it will only return a single unit.

---

<div class="post-metadata">

**Author:** ![mikeh1239](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@mikeh1239](https://discuss.openedx.org/u/mikeh1239)\
**Post date:** [December 3, 2021, 10:09pm UTC](https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192/3 "2021-12-03T22:09:04Z")

</div>

Thank you for your generosity and expertise!

---

<div class="post-metadata">

**Author:** ![febriy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/febriy/32/7958_2.png) [@febriy](https://discuss.openedx.org/u/febriy)\
**Post date:** [February 14, 2025, 5:47am UTC](https://discuss.openedx.org/t/identify-xblocks-used-on-specific-pages/6192/4 "2025-02-14T05:47:23Z")

</div>

Hi, which database are these stored in?

My goal is to track student completion in a course, and within the chapter.  
I see that completion\_blockcompletion and courseware\_studentmodule stores the completion done by a student.

I need to compare this with the totality of all the xblock/ part of an entire chapter/ course.

Which table should I refer to?

Thank you.
