# Reading json on jupyter notebook

**URL:** https://discourse.jupyter.org/t/reading-json-on-jupyter-notebook/19394
**Category:** Notebook
**Tags:** how-to
**Created:** [May 15, 2023, 9:05am UTC](https://discourse.jupyter.org/t/reading-json-on-jupyter-notebook/19394 "2023-05-15T09:05:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GreenLynx](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/greenlynx/32/13349_2.png) [@GreenLynx](https://discourse.jupyter.org/u/GreenLynx)
#### Post date: [May 15, 2023, 9:05am UTC](https://discourse.jupyter.org/t/reading-json-on-jupyter-notebook/19394/1 "2023-05-15T09:05:25Z")

</div>

Hi,  
I’m trying to read a json url in notebook however I’ve got this error:  
“TypeError: list indices must be integers or slices, not str”

This is de json url: [https://servicios.ine.es/wstempus/js/es/DATOS\_TABLA/33848?tip=AM&](https://servicios.ine.es/wstempus/js/es/DATOS_TABLA/33848?tip=AM&)  
and the idea is see it in jupyter notebook as a table with this columns  
“Año”, “Municipio”, “De 0 a 4 años”, “De 5 a 9 años”, “De 10 a 14 años”, etc, but I can’t do it  
Any idea or help?

Thank you

---

<div class="post-metadata">

### Author: ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)
#### Post date: [May 15, 2023, 2:58pm UTC](https://discourse.jupyter.org/t/reading-json-on-jupyter-notebook/19394/2 "2023-05-15T14:58:49Z")

</div>

> [@GreenLynx](#):
>
> but I can’t do it

What can you do? You got far enough to somehow get `“TypeError: list indices must be integers or slices, not str”`; however, you don’t share what you tried, which is always expected when asking for help.

I’d add that this is not on-topic for this forum. This looks to be a Python question and not a Jupyter question. A good way to tell is to ask yourself if I ran this code as a Python script or in the Python interpreter directly, would the the outcome be expected to be the same? If that is the case, then it isn’t suitable for this forum.  
My advice above will be pertinent wherever you post a question like this.

---

<div class="post-metadata">

### Author: ![GreenLynx](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/greenlynx/32/13349_2.png) [@GreenLynx](https://discourse.jupyter.org/u/GreenLynx)
#### Post date: [May 16, 2023, 8:49am UTC](https://discourse.jupyter.org/t/reading-json-on-jupyter-notebook/19394/3 "2023-05-16T08:49:09Z")

</div>

Hola fomightez,

Agradezco tu aclaración por mi error al escribir en el foro equivocado, tienes toda la razón que es más de Python, perdona.

Un saludo,
