# How to add uplink metadata to the payload? Eg add 'metadata.data\_rate' spreading factor info to my payload

**URL:** <https://www.thethingsnetwork.org/forum/t/how-to-add-uplink-metadata-to-the-payload-eg-add-metadata-data-rate-spreading-factor-info-to-my-payload/22805>\
**Category:** Application Development\
**Created:** [February 16, 2019, 7:32am UTC](https://www.thethingsnetwork.org/forum/t/how-to-add-uplink-metadata-to-the-payload-eg-add-metadata-data-rate-spreading-factor-info-to-my-payload/22805 "2019-02-16T07:32:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Custom-IoT](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/custom-iot/32/35697_2.png) [@Custom-IoT](https://www.thethingsnetwork.org/forum/u/Custom-IoT)\
**Post date:** [February 16, 2019, 7:32am UTC](https://www.thethingsnetwork.org/forum/t/how-to-add-uplink-metadata-to-the-payload-eg-add-metadata-data-rate-spreading-factor-info-to-my-payload/22805/1 "2019-02-16T07:32:11Z")

</div>

I would like to add to my device payload the metadata information

For later analysis and storage  
to see what sensors work best and what spread factor they use for each message,

Is this information available to the ‘function Decoder(bytes, port)’  
I am struggling to find an example on how I can do this.

ie. {  
“time”: “2019-02-16T07:22:04.3006654Z”,  
“frequency”: 923.2,  
“modulation”: “LORA”,  
“data\_rate”: “SF11BW125”,  
“coding\_rate”: “4/5”,  
“gateways”: [  
{  
“gtw\_id”: “newie-ventures-launch”,  
“gtw\_trusted”: true,  
“timestamp”: 2580972788,  
“time”: “2019-02-16T07:30:50Z”,  
“channel”: 0,  
“rssi”: -113,  
“snr”: 5.25,  
“latitude”: -32.883595,  
“longitude”: 151.72795,  
“altitude”: 20,  
“location\_source”: “registry”  
}  
]  
}

Any help appreciated

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [February 16, 2019, 8:08am UTC](https://www.thethingsnetwork.org/forum/t/how-to-add-uplink-metadata-to-the-payload-eg-add-metadata-data-rate-spreading-factor-info-to-my-payload/22805/2 "2019-02-16T08:08:31Z")

</div>

See [Access Metadata in decoder](https://www.thethingsnetwork.org/forum/t/access-metadata-in-decoder/19118).

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [February 16, 2019, 8:08am UTC](https://www.thethingsnetwork.org/forum/t/how-to-add-uplink-metadata-to-the-payload-eg-add-metadata-data-rate-spreading-factor-info-to-my-payload/22805/3 "2019-02-16T08:08:56Z")

</div>


