# Split Text Data From API response

**URL:** <https://community.n8n.io/t/split-text-data-from-api-response/27999>\
**Category:** Questions\
**Tags:** data-transformation\
**Created:** [July 10, 2023, 9:11pm UTC](https://community.n8n.io/t/split-text-data-from-api-response/27999 "2023-07-10T21:11:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davey](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/davey/32/6889_2.png) [@Davey](https://community.n8n.io/u/Davey)\
**Post date:** [July 10, 2023, 9:11pm UTC](https://community.n8n.io/t/split-text-data-from-api-response/27999/1 "2023-07-10T21:11:47Z")

</div>

```auto
[
  {
    "data": "{\"status\":1,\"response\":{\"Model\":\"iPhone 12 Pro 128GB Pacific Blue [iPhone133] [A2341]\",\"Model Number\":\"iPhone 12 Pro (A2341)\",\"IMEI\":\"358915484787806\",\"IMEI2\":\"358915484975047\",\"Serial Number\":\"F17FL4JU0D83\",\"Carrier\":\"Unlock\",\"Country\":\"N\\/A\",\"Simlock\":\"UNLOCKED\",\"FMI\":\"OFF\",\"iCloud\":\"CLEAN\",\"Blacklist Status\":\"CLEAN\"}}"
  }
]

```

The attached example node shows how the data comes in from an API on the http node. How can I split this response into individual key pairs, without knowing the exact number of items that will be in each string. Example: Some might contain 1 IMEI, others might contain 2. So I can’t just rely on mapping the chunk #s.

---

<div class="post-metadata">

**Author:** ![giulioandreini](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/giulioandreini/32/20129_2.png) [@giulioandreini](https://community.n8n.io/u/giulioandreini)\
**Post date:** [July 11, 2023, 9:52am UTC](https://community.n8n.io/t/split-text-data-from-api-response/27999/4 "2023-07-11T09:52:01Z")

</div>

Hi @Davey,  
is this the output you expect?

```auto
[
  {
    "Model": "iPhone 12 Pro 128GB Pacific Blue [iPhone133] [A2341]",
    "Model Number": "iPhone 12 Pro (A2341)",
    "IMEI": "358915484787806",
    "IMEI2": "358915484975047",
    "Serial Number": "F17FL4JU0D83",
    "Carrier": "Unlock",
    "Country": "N/A",
    "Simlock": "UNLOCKED",
    "FMI": "OFF",
    "iCloud": "CLEAN",
    "Blacklist Status": "CLEAN"
  }
]

```

Here’s a sample workflow that produces two types of output, let me know if it solves your problem:

All the best

---

<div class="post-metadata">

**Author:** ![Davey](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/davey/32/6889_2.png) [@Davey](https://community.n8n.io/u/Davey)\
**Post date:** [July 11, 2023, 4:05pm UTC](https://community.n8n.io/t/split-text-data-from-api-response/27999/5 "2023-07-11T16:05:24Z")

</div>

That’s exactly what I wanted. Thank You!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 18, 2023, 4:06pm UTC](https://community.n8n.io/t/split-text-data-from-api-response/27999/6 "2023-07-18T16:06:09Z")

</div>

Closed on July 18, 2023, 4:06pm UTC

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