I created a C# programm which searches movie details with the title of the movie. I create the link:
string link = "https://itunes.apple.com/search?";
link += "term=";
string cTitle = Titel.Replace(" ", "+");
link += cTitle;
link += "&country=DE";
link += "&media=movie";
link += "&entity=movie";
link += "&attribute=movieTerm";
link += "&limit=1";
with the movie title "Bus 657" that would be the following link:
If I open that link I get a txt file with the result I need. But if I get that in c# with the following code:
WebClient client = new WebClient();
var json = client.DownloadString(link);
Thread.Sleep(3100);
I get 0 results. Can someone help me to fix that?
I have a lot movie titles which title are named by the original iTunes title of the store at germany.
Thx :)
Add the User Agent to the request header and try.
WebClient client = new WebClient();
client.Headers.Add("user-agent","Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
var json = client.DownloadString(link);
I received "resultCount":1