HTTP Streaming

With HTTP Streaming, the client opens an HTTP connection and consumes content passed along that connection until one of the parties closes the connection.

Please make sure you've looked at the Streaming API introduction. There are step-by-step guides and code examples for a variety of client libraries.

Request Headers

With the Streaming API, set the Connection header to "Keep-Alive". Also notice the authorization header is using dummy data. You will need to use your username and API key.

GET /8bc638ddff76a9c01bd6a454de03bd30 HTTP/1.1
Host: stream.datasift.com
Authorization: <username>:<api_key>
Connection: Keep-Alive

Response Headers

Please note that the numbers appearing above each interaction are the chunk sizes as the Transfer-Encoding header is set to "chunked".

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked

1

821
{    "interaction": {
        "source": "foursquare",
        "author": {
            "username": "TheRandySteel",
            "name": "Randy Steel",
            "id": 267893289,
            "avatar": "http://a2.twimg.com/profile_images/1277220827/189785_1594515475027_1600158671_31188680_3467740_n_normal.jpg",
            "link": "http://twitter.com/TheRandySteel"
        },
        "type": "twitter",
        "link": "http://twitter.com/TheRandySteel/statuses/124144939763380224",
        "created_at": "Wed, 12 Oct 2011 15:30:34 +0000",
        "content": "I'm at NuRiver Landing (511 SE 5th Ave, Fort Lauderdale) http://t.co/J5QkWNAY",
        "id": "1e0f4e72070ca900e074d60bd57ac250",
        "geo": {
            "latitude": 26.11673,
            "longitude": -80.13942
        }
    },
    "twitter": {
        "user": {
            "name": "Randy Steel",
            "description": "Chairman/CEO RJS International Group, a group of Green companies. Software Engineer, Photographer, Writer, Radio Personality, and sometimes cowboy.",
            "location": "Fort Lauderdale",
            "statuses_count": 2425,
            "followers_count": 40,
            "friends_count": 11,
            "screen_name": "TheRandySteel",
            "lang": "en",
            "time_zone": "Eastern Time (US & Canada)",
            "listed_count": 1,
            "id": 267893289,
            "id_str": "267893289",
            "url": "http://randysteel.com",
            "geo_enabled": true
        },
        "place": {
            "place_type": "poi",
            "country": "United States",
            "country_code": "US",
            "full_name": "Nu River Landing, Fort Lauderdale",
            "name": "Nu River Landing",
            "url": "http://api.twitter.com/1/geo/id/4d7d9c20ca3fb2a8.json",
            "attributes": {
                "street_address": "511 Se 5th Ave"
            },
            "id": "4d7d9c20ca3fb2a8"
        },
        "links": [
            "http://4sq.com/qSZsnY"
        ],
        "domains": [
            "4sq.com"
        ],
        "id": "124144939763380224",
        "text": "I'm at NuRiver Landing (511 SE 5th Ave, Fort Lauderdale) http://t.co/J5QkWNAY",
        "source": "<a href=\"http://foursquare.com\" rel=\"nofollow\">foursquare</a>",
        "created_at": "Wed, 12 Oct 2011 15:30:34 +0000",
        "geo": {
            "latitude": 26.11673,
            "longitude": -80.13942
        }
    },
    "links": {
        "url": [
            "https://foursquare.com/therandysteel/checkin/4e95b29af790e89d3828e988?s=J99sf_QJmPbp0Ec7_5gm5r7Kv9w&ref=tw"
        ],
        "domain": [
            "foursquare.com"
        ],
        "title": [
            "foursquare"
        ],
        "retweet_count": [
            0
        ]
    },
    "klout": {
        "score": 24,
        "network": 32,
        "amplification": 11,
        "true_reach": 19
    },
    "language": {
        "tag": "en"
    },
    "salience": {
        "content": {
            "sentiment": 0
        }
    }
}5bb{
    "interaction": {
        "source": "Twitter for Android",
        "author": {
            "username": "Brigadeiro8",
            "name": "@Nii_Juniior «3",
            "id": 314151783,
            "avatar": "http://a1.twimg.com/profile_images/1584515499/seXT42To_normal",
            "link": "http://twitter.com/Brigadeiro8"
        },
        "type": "twitter",
        "link": "http://twitter.com/Brigadeiro8/statuses/124144956070834177",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000",
        "content": "daqui a pouko voou tomar banhoo e ir trabalhar kk",
        "id": "1e0f4e722d32a300e074ec40bf77d614",
        "geo": {
            "latitude": -23.512321,
            "longitude": -46.7802239
        }
    },
    "twitter": {
        "user": {
            "name": "@Nii_Juniior «3",
            "description": "Marcela B,capricorniana,16,#Pitty♫,chocolover, #eletrica,simpatica,carinhonsa, #Deus,amigos {...} Vicios:Toddy & ♥Two and a half men {+} Skate",
            "location": "Osasco-Sp'",
            "statuses_count": 9950,
            "followers_count": 200,
            "friends_count": 256,
            "screen_name": "Brigadeiro8",
            "lang": "pt",
            "time_zone": "Santiago",
            "listed_count": 19,
            "id": 314151783,
            "id_str": "314151783",
            "geo_enabled": true
        },
        "place": {
            "place_type": "city",
            "country": "Brasil",
            "country_code": "BR",
            "full_name": "Osasco, São Paulo",
            "name": "Osasco",
            "url": "http://api.twitter.com/1/geo/id/32e64dedd065063f.json",
            "attributes": {
            },
            "id": "32e64dedd065063f"
        },
        "id": "124144956070834177",
        "text": "daqui a pouko voou tomar banhoo e ir trabalhar kk",
        "source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000",
        "geo": {
            "latitude": -23.512321,
            "longitude": -46.7802239
        }
    }
}685{
    "interaction": {
        "source": "web",
        "author": {
            "username": "Nannecosta",
            "name": "thaianne costa",
            "id": 58229136,
            "avatar": "http://a2.twimg.com/profile_images/1573245763/passeio_chic_9_20110618_1149640447_normal.jpg",
            "link": "http://twitter.com/Nannecosta"
        },
        "type": "twitter",
        "link": "http://twitter.com/Nannecosta/statuses/124144954758012928",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000",
        "content": "@jackmaia @Olanna  Martdita Pinga (2)",
        "id": "1e0f4e722d32a300e0748538803b7bd0",
        "geo": {
            "latitude": -43.4473095,
            "longitude": -22.916032
        }
    },
    "twitter": {
        "in_reply_to_screen_name": "jackmaia",
        "user": {
            "name": "thaianne costa",
            "description": "Carioca a Vida Inteira ,Fisioterapeuta De segunda a Sexta, Baladeira Nos Fds,Atleta em época de Campeonato e Namorada Nas Datas especiais ;)",
            "location": "Rio De janeiro",
            "statuses_count": 11860,
            "followers_count": 1889,
            "friends_count": 1825,
            "screen_name": "Nannecosta",
            "lang": "pt",
            "time_zone": "Brasilia",
            "listed_count": 56,
            "id": 58229136,
            "id_str": "58229136",
            "url": "http://www.nannecosta.blogspot.com",
            "geo_enabled": true
        },
        "place": {
            "place_type": "city",
            "country": "Brasil",
            "country_code": "BR",
            "full_name": "Rio de Janeiro, Rio de Janeiro",
            "name": "Rio de Janeiro",
            "url": "http://api.twitter.com/1/geo/id/97bcdfca1a2dca59.json",
            "attributes": {
            },
            "id": "97bcdfca1a2dca59"
        },
        "mentions": [
            "jackmaia",
            "Olanna"
        ],
        "id": "124144954758012928",
        "text": "@jackmaia @Olanna  Martdita Pinga (2)",
        "source": "web",
        "in_reply_to_status_id": "124144606051966976",
        "in_reply_to_user_id": "47249814",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000"
    },
    "klout": {
        "score": 42,
        "network": 52,
        "amplification": 18,
        "true_reach": 737
    },
    "language": {
        "tag": "tl"
    }
}6cd{
    "interaction": {
        "source": "Gravity!",
        "author": {
            "username": "yigitkirpi",
            "name": "Yiğit S. Kirpi",
            "id": 151992822,
            "avatar": "http://a2.twimg.com/profile_images/1569848448/63485839863791250_normal.jpg",
            "link": "http://twitter.com/yigitkirpi"
        },
        "type": "twitter",
        "link": "http://twitter.com/yigitkirpi/statuses/124144956288942080",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000",
        "content": "Sibel'in kapımı çalıp beni kahveye davet etmesi ? @birtepkiolarak",
        "id": "1e0f4e722d32a300e074c9e2ef26a8f2",
        "geo": {
            "latitude": 40.97100313,
            "longitude": 29.14275402
        }
    },
    "twitter": {
        "user": {
            "name": "Yiğit S. Kirpi",
            "description": "Freud addict, Hamlet critic, Liberal, A Person with OCD, Flight Attendant, Translator&Interpreter, Human Hater, Queer and  Premenstrual Syndrom Person ::",
            "location": "Istanbul",
            "statuses_count": 15987,
            "followers_count": 518,
            "friends_count": 64,
            "screen_name": "yigitkirpi",
            "lang": "en",
            "time_zone": "Istanbul",
            "listed_count": 17,
            "id": 151992822,
            "id_str": "151992822",
            "url": "http://yigitkirpi.tumblr.com/",
            "geo_enabled": true
        },
        "place": {
            "place_type": "country",
            "country": "Turkey",
            "country_code": "TR",
            "full_name": "Turkey",
            "name": "Turkey",
            "url": "http://api.twitter.com/1/geo/id/682c5a667856ef42.json",
            "attributes": {
            },
            "id": "682c5a667856ef42"
        },
        "mentions": [
            "birtepkiolarak"
        ],
        "id": "124144956288942080",
        "text": "Sibel'in kapımı çalıp beni kahveye davet etmesi ? @birtepkiolarak",
        "source": "<a href=\"http://mobileways.de/gravity\" rel=\"nofollow\">Gravity!</a>",
        "created_at": "Wed, 12 Oct 2011 15:30:38 +0000",
        "geo": {
            "latitude": 40.97100313,
            "longitude": 29.14275402
        }
    },
    "klout": {
        "score": 48,
        "network": 55,
        "amplification": 29,
        "true_reach": 194
    },
    "language": {
        "tag": "no"
    }
}