# Get informations when stream is offline

**URL:** <https://discuss.dev.twitch.com/t/get-informations-when-stream-is-offline/2084>\
**Category:** API\
**Created:** [April 21, 2015, 11:22am UTC](https://discuss.dev.twitch.com/t/get-informations-when-stream-is-offline/2084 "2015-04-21T11:22:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OneTouch](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/onetouch/32/442_2.png) [@OneTouch](https://discuss.dev.twitch.com/u/OneTouch)\
**Post date:** [April 21, 2015, 11:22am UTC](https://discuss.dev.twitch.com/t/get-informations-when-stream-is-offline/2084/1 "2015-04-21T11:22:40Z")

</div>

Hello,

How can i get informations like profil picture when stream is offline ?

$channelName = \*\*\*\*\*\*;  
$json\_array = json\_decode(file\_get\_contents(‘[https://api.twitch.tv/kraken/streams/](https://api.twitch.tv/kraken/streams/)’.strtolower($channelName)), true);

```
	        if ($json_array['stream'] != null) {

		$currentGame = $json_array['stream']['channel']['game'];
		$channelTitle = $json_array['stream']['channel']['display_name'];
		$streamTitle = $json_array['stream']['channel']['status'];
		$viewers = $json_array['stream']['viewers'];
        $logo = $json_array['stream']['channel']['logo'];
       
		}

```

It’s work when the stream is online,but not when stream is offline

I have search and the stream key is always null when stream is offline.So what can i do?

Thank’s for your helps,

Edit : Solve

---

<div class="post-metadata">

**Author:** ![mcacciatore116](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcacciatore116](https://discuss.dev.twitch.com/u/mcacciatore116)\
**Post date:** [April 25, 2015, 8:34pm UTC](https://discuss.dev.twitch.com/t/get-informations-when-stream-is-offline/2084/2 "2015-04-25T20:34:33Z")

</div>

Use [https://api.twitch.tv/kraken/channels/test\_channel](https://api.twitch.tv/kraken/channels/test_channel) instead

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [May 25, 2015, 8:34pm UTC](https://discuss.dev.twitch.com/t/get-informations-when-stream-is-offline/2084/3 "2015-05-25T20:34:55Z")

</div>

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