Search stream by location doesn't work

Oct 14, 2013 at 2:58 PM
I am trying to filter a twitter stream in a certain area defined by coördinates. This works, but only if the area is big enough (continent wide). If I try a smaller area (as big as a city), it doesn't work anymore.

The remote server returned an error: (406) Not Acceptable.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Streaminvi;
using TweetinCore.Interfaces;
using TweetinCore.Interfaces.StreamInvi;
using TweetinCore.Interfaces.TwitterToken;
using Tweetinvi;
using Tweetinvi.Model;
using TwitterToken;

namespace twitter_test
public partial class Form1 : Form
    private const string userKey = "...";
    private const string userSecret = "...";
    private const string consumerKey = "...";
    private const string consumerSecret = "...";

    public Form1()
        IToken token = new Token(userKey, userSecret, consumerKey, consumerSecret);



    private static void StreamFilterLocationExample(IToken token)
        var topLeft = new Coordinates(51.378638, 2.394161);
        var bottomRight = new Coordinates(50.774682, 6.173458);

        var stream = new FilteredStream();
        stream.AddLocation(topLeft, bottomRight);

        int max = 0;
        Action<ITweet> tweetReceived = t =>
            if (max<15)

        stream.StartStream(token, tweetReceived);

Oct 14, 2013 at 3:14 PM
Hi Charlotte,

I will check this this evening and give you an answer.

Oct 14, 2013 at 3:29 PM
Hi Linvi,

Thanks for the fast reply. I was looking through the other topics and you thought you fixed the problem in your latest but apparently the problem is still there.

Oct 14, 2013 at 9:52 PM
Hello CharlotteK,

Would you please verify your credentials as well as your version.
Tweetinvi had an issue concerning the 406 exception but I tried your code with the and everything worked perfectly for me on Windows 7 and Windows 8.1.

If your credentials are correct you can send me a sample of your project so that I can figure out what is going wrong.

Oct 29, 2013 at 11:44 AM
For developers coming to this post.

Charlotte had 2 issues :
  • 406 Exception : A first issue related with a bug in Tweetinvi. Based on her computer Culture the double were transformed into string differently than what Twitter was expecting. This bug has now been solved.
  • 401 Exception : The time on the computer being incorrectly set cause twitter webservice to reject the request and send a 401 Exception. Updating the time on the computer to the current time and time zone solved the issue.
Hope this might help some of you :)

Marked as answer by linvi on 10/29/2013 at 4:44 AM