# json\_foreach on root array

**URL:** https://community.mp3tag.de/t/json-foreach-on-root-array/19518
**Category:** Web Sources Discussion
**Created:** [November 12, 2017, 8:10am UTC](https://community.mp3tag.de/t/json-foreach-on-root-array/19518 "2017-11-12T08:10:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![The-Lion](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@The-Lion](https://community.mp3tag.de/u/The-Lion)
#### Post date: [November 12, 2017, 8:10am UTC](https://community.mp3tag.de/t/json-foreach-on-root-array/19518/1 "2017-11-12T08:10:56Z")

</div>

Hi,

I can't find any documentation about iterating over a root json array with json\_foreach.

The json\_foreach command requires exactly one argument: the key on which to iterate. However when the json result starts with an array it's not possible to iterate on it?

```
[{key:'value'},{key:'value'}]

```

vs

```
{results: [{key:'value'},{key:'value'}]}
```

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 22, 2017, 4:27pm UTC](https://community.mp3tag.de/t/json-foreach-on-root-array/19518/2 "2017-11-22T16:27:19Z")

</div>

Thanks for pointing. I've added support for unnamed root arrays with [Mp3tag v2.85a](http://developer.mp3tag.de).

Kind regards  
— Florian

---

<div class="post-metadata">

### Author: ![The-Lion](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@The-Lion](https://community.mp3tag.de/u/The-Lion)
#### Post date: [November 24, 2017, 7:51am UTC](https://community.mp3tag.de/t/json-foreach-on-root-array/19518/3 "2017-11-24T07:51:38Z")

</div>

Thanks Florian! I look forward to it.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [May 1, 2025, 8:13am UTC](https://community.mp3tag.de/t/json-foreach-on-root-array/19518/5 "2025-05-01T08:13:54Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
