How to connect to API 1.1 with javascript and arduino possibly using OAuth authentication?


Help help help!

I have made a website + a project in Arduino that both fetches tweets from my own twitter account and acts according to these. Today the twitter API changed to version 1.1 and now my website doesn’t work. I am supposted to present my project for an exam tomorrow, so I am in complete panic.

On my website I have been using javascript with this code:

var twitter_api_url = '';" 
$.getJSON( twitter_api_url  + '?callback=?&rpp=5&q=from:' + twitter_user, function(data) { ". 

This is not working and I don’t know how to change it.

In Arduino I call:

client.println("GET /1/statuses/user_timeline.xml?screen_name=MYTWITTER HTTP/1.1");

I get error message 410 (gone) and “The Twitter REST API v1 will soon stop functioning. Please migrate to API v1.1.”.

I have tried searching for fixes but I can’t find the correct solution. I think that I might need to make an OAuth authentication? I found a guide to create parametres for this “”, but I don’t know how to add the parametres to javascript or Arduino.

I found a suggestion for Arduino:

client.print(F("GET /1/statuses/user_timeline.xml?screen_name=MYTWITTER HTTP/1.1"));
client.print(F("Authorization: OAuth oauth_consumer_key=\"XXX\", oauth_nonce=\"XXX\", oauth_signature=\"XXX\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1361444134\", oauth_token=\"XXX\", oauth_version=\"1.0\""));

But I don’t know what oauth_nonce and oauth_signature and oauth_timestamp is supposed to be. Another user also replied that this didn’t work, so I don’t know if I want to continue with it.

Can someone please help me, thanks?


here is the solution. you can find what you looking for on the site


Hi @LCDyhr – if you want to continue using the API in JQuery like that, one easy way is just to add a small extra bit of code to act as a proxy between your JavaScript and the API.

E.g. How to use Twitter API 1.1 in JavaScript code, bypassing oAuth authentication on the client-side:


In your link , You are using server side scripting (

Is it possible to use Twitter API 1.1 in JavaScript code, by passing oAuth authentication on the client-side scripting (JavaScript, JQuery).



I need to configure an api call to twitter for the sign component, which will require 2 scenarios:
1- if not connect, prompt for sign in, then prompt for application consent;
2- if connected, prompt for application consent;