# Command Line Network Import - where to find the channel ID's

**URL:** <https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529>\
**Category:** Kolibri\
**Created:** [March 4, 2018, 1:33pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529 "2018-03-04T13:33:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobicycle](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/nobicycle/32/131_2.png) [@nobicycle](https://community.learningequality.org/u/nobicycle)\
**Post date:** [March 4, 2018, 1:33pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/1 "2018-03-04T13:33:30Z")

</div>

The last section of the Kolibri documentation describes command line utilities, one for network import:

> kolibri manage importchannel – network Channel\_ID

I was wondering how to get a list of Channel ID’s and names?

To get a list of locally active channels one can use :

> sqlite3 ‘file:$KOLIBRI\_HOME/.kolibri/db.sqlite3?mode=ro’ ‘SELECT name,id FROM content\_channelmetadata’

What I would like is a list of {name,id} for all available channels. Is there a url for the Central Server that would provide this information?

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/laura/32/69_2.png) [@laura](https://community.learningequality.org/u/laura)\
**Post date:** [March 5, 2018, 9:46pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/2 "2018-03-05T21:46:26Z")

</div>

Hi nobicycle,

I’ll PM you directly for accessing this information on Studio.

Best,  
Laura

---

<div class="post-metadata">

**Author:** ![nobicycle](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/nobicycle/32/131_2.png) [@nobicycle](https://community.learningequality.org/u/nobicycle)\
**Post date:** [July 14, 2018, 5:33pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/3 "2018-07-14T17:33:30Z")

</div>

Hi again Laura,  
The URL you gave me no longer works. Not sure why you used a PM last time, so I won’t print the URL you gave me. However it does not work now.

Regards

---

<div class="post-metadata">

**Author:** ![laura](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/laura/32/69_2.png) [@laura](https://community.learningequality.org/u/laura)\
**Post date:** [July 16, 2018, 2:51pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/4 "2018-07-16T14:51:54Z")

</div>

Hi nobicycle,

Which link wasn’t working for you? I’m following up over PM as we haven’t publicly announced Kolibri Studio yet. Let me know if I can assist further.

Best,  
Laura

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 1:51pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/6 "2023-03-21T13:51:21Z")

</div>

This answer is quite old, but I did not find another one.

On Internet in a Box there is functionality to bulk load content in Ka-lite by language and any node in the content tree by reading the content meta data, traversing the tree, and downloading individual videos.

In Kolibri there is kolibri manage importchannel network .

I do not see how to get the channel ID.

Is it what is in the url, such as [http://192.168.3.162/kolibri/en/device/#/content/channels/c1f2b7e6ac9f56a2bb44fa7a48b66dce?node\_id=463e348d658355489b2bf7134518d3ba](http://192.168.3.162/kolibri/en/device/#/content/channels/c1f2b7e6ac9f56a2bb44fa7a48b66dce?node_id=463e348d658355489b2bf7134518d3ba)?

For public channels does it remain constant?

Is there a public API to get all content?

In the above example from ES Khan Academy I have drilled down to a single topic. Is there a syntax for importchannel that allows me to import less than an entire channel?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/richard/32/10_2.png) [@richard](https://community.learningequality.org/u/richard)\
**Post date:** [March 21, 2023, 5:00pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/7 "2023-03-21T17:00:44Z")

</div>

Hi @Tim,

There is a public API on Studio to retrieve all the of the public channels. It is available here:

[https://studio.learningequality.org/api/public/v1/channels](https://studio.learningequality.org/api/public/v1/channels)

These channel ids are stable for public channels, except in extreme circumstances. In the last 6 years there has only been a single instance where we have had to change the id of a public channel when doing an update, so you should be able to rely on this.

`importchannel` only imports the channel metadata, not the content.

You will also need to use the `importcontent` command to import resources. (the use of both of these commands is described here: [Working with Kolibri from the command line — Kolibri User Guide](https://kolibri.readthedocs.io/en/latest/manage/command_line.html#import-channels-from-internet))

What is not documented above is the ability to use `--node_ids <node_id1>,<node_id2>...` to only include specific folders/resources (if you specify a folder it will also import all descendant folders and resources), this can also be combined with `--exclude_node_ids <node_id3>,<node_id4>...` to exclude specific folders or resources.

Hope this helps! For more details, the best reference is the management command itself: [kolibri/importcontent.py at release-v0.15.x · learningequality/kolibri · GitHub](https://github.com/learningequality/kolibri/blob/release-v0.15.x/kolibri/core/content/management/commands/importcontent.py#L69)

Kind Regards,  
Richard

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 5:21pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/8 "2023-03-21T17:21:52Z")

</div>

That helps a great deal. How stable are the node\_ids for public channels, especially Khan Academy? And how do I look them up (without manually accessing each url like above)?

For example I can set the following json for the iiab kalite loader and it will look up the assets in the database as well as compute the storage requirements.

“kalite”: {  
“lang\_code”: “es”,  
“topics”: [“khan/math/trigonometry/trigonometry-right-triangles/”,  
“khan/math/trigonometry/trig-with-general-triangles/”,  
“khan/math/trigonometry/unit-circle-trig-func/”  
]

---

<div class="post-metadata">

**Author:** ![richard](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/richard/32/10_2.png) [@richard](https://community.learningequality.org/u/richard)\
**Post date:** [March 21, 2023, 5:27pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/9 "2023-03-21T17:27:47Z")

</div>

The ids for nodes in public channels are also stable, as they are based off a predictable hash of the source that would only change if the source channel changed its unique identifiers.

In terms of getting them, they would have to be accessed either via the UI, the API, or by inspecting the channel database through a tool like [SQLiteBrowser](https://sqlitebrowser.org/), for example.

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 5:57pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/10 "2023-03-21T17:57:07Z")

</div>

by API do you mean [https://studio.learningequality.org/api/public/v1/channels](https://studio.learningequality.org/api/public/v1/channels)? I don’t see any node\_ids.

I tried to follow [kolibri/api\_endpoints.rst at develop · learningequality/kolibri · GitHub](https://github.com/learningequality/kolibri/blob/develop/docs/backend_architecture/content/api_endpoints.rst)  
with  
[https://studio.learningequality.org/api/public/v1/channels/contentnode?search=Seguridad%20en%20Internet](https://studio.learningequality.org/api/public/v1/channels/contentnode?search=Seguridad%20en%20Internet)

But I am clearly just guessing.

Also  
kolibri manage importchannel network c1f2b7e6ac9f56a2bb44fa7a48b66dce  
seemed to work  
but kolibri manage importcontent network c1f2b7e6ac9f56a2bb44fa7a48b66dce --node-ids 463e348d658355489b2bf7134518d3ba  
yields  
kolibri manage importcontent: error: unrecognized arguments: --node-ids 463e348d658355489b2bf7134518d3ba

---

<div class="post-metadata">

**Author:** ![richard](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/richard/32/10_2.png) [@richard](https://community.learningequality.org/u/richard)\
**Post date:** [March 21, 2023, 7:01pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/11 "2023-03-21T19:01:47Z")

</div>

Apologies, I made a typo, it should be `--node_ids` and `--exclude_node_ids`. I’ll correct the original post.

The APIs I was referring to were the internal ones used by Kolibri to navigate the topic tree in the import UI.

However, it may be simpler to just get the ids from the URLs as you are navigating the UI, this should be fairly straight forward if you want to import three specific topics.

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 7:04pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/12 "2023-03-21T19:04:32Z")

</div>

kolibri manage importcontent: error: unrecognized arguments: --node\_ids 463e348d658355489b2bf7134518d3ba

---

<div class="post-metadata">

**Author:** ![richard](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/richard/32/10_2.png) [@richard](https://community.learningequality.org/u/richard)\
**Post date:** [March 21, 2023, 7:13pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/13 "2023-03-21T19:13:44Z")

</div>

Are they preceding the `network <channel_id>` argument? See here for the code comment documenting this: [kolibri/importcontent.py at release-v0.15.x · learningequality/kolibri · GitHub](https://github.com/learningequality/kolibri/blob/release-v0.15.x/kolibri/core/content/management/commands/importcontent.py#L74)

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 7:19pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/14 "2023-03-21T19:19:24Z")

</div>

kolibri manage importcontent --node\_ids 463e348d658355489b2bf7134518d3ba network c1f2b7e6ac9f56a2bb44fa7a48b66dce works. had node\_ids at the end.

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 7:50pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/15 "2023-03-21T19:50:16Z")

</div>

but I don’t see the content. only the one I imported with studio.

---

<div class="post-metadata">

**Author:** ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://community.learningequality.org/u/Tim)\
**Post date:** [March 21, 2023, 8:08pm UTC](https://community.learningequality.org/t/command-line-network-import-where-to-find-the-channel-ids/529/16 "2023-03-21T20:08:51Z")

</div>

tried restarting Kolibri but ES content still not there

the output was

INFO 2023-03-21 19:18:30,308 Setting availability to True of 81 LocalFile objects based on passed in checksums  
INFO 2023-03-21 19:18:30,344 Setting availability of non-topic ContentNode objects based on LocalFile availability in 6 batches of 10000  
INFO 2023-03-21 19:18:30,460 Annotating ContentNode objects with children for 6 levels  
INFO 2023-03-21 19:18:30,593 Annotating ContentNode objects with children for level 6  
INFO 2023-03-21 19:18:30,596 Annotating ContentNode objects with children for level 5  
INFO 2023-03-21 19:18:30,617 Annotating ContentNode objects with children for level 4  
INFO 2023-03-21 19:18:30,626 Annotating ContentNode objects with children for level 3  
INFO 2023-03-21 19:18:30,629 Annotating ContentNode objects with children for level 2  
INFO 2023-03-21 19:18:30,630 Annotating ContentNode objects with children for level 1

OK. I suspect the problem is with KOLIBRI\_HOME not being set properly.
