conradweiser / unofficial-robinhood-api Goto Github PK
View Code? Open in Web Editor NEWJava Wrapper for the Robinhood Investing App/Service
License: MIT License
Java Wrapper for the Robinhood Investing App/Service
License: MIT License
had to update the fundamentals endpoint to add auth token to meet newer requirements. Then had to move "verifytickerdata" before setOrderParameters.
even afterwards, I get 400 bad request when doing either market or limit. Can anyone else successfully do an order right now?
When I try to log in using this simple code:
public static void main(String[] args) {
RobinhoodApi api = null;
try {
api = new RobinhoodApi(<USER>,<PASSWORD>);
} catch (RobinhoodApiException e) {
e.printStackTrace();
}
try {
System.out.println(api.getAccountData());
} catch (RobinhoodNotLoggedInException e) {
e.printStackTrace();
} catch (RobinhoodApiException e) {
e.printStackTrace();
}
}
I get this error:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)
at com.google.gson.Gson.fromJson(Gson.java:887)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at conrad.weiser.robinhood.api.request.RequestManager.makePostRequest(RequestManager.java:110)
at conrad.weiser.robinhood.api.request.RequestManager.makeApiRequest(RequestManager.java:58)
at conrad.weiser.robinhood.api.RobinhoodApi.logUserIn(RobinhoodApi.java:129)
at conrad.weiser.robinhood.api.RobinhoodApi.<init>(RobinhoodApi.java:84)
at Test.main(Test.java:11)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213)
... 8 more
Printing out the POST response from Robinhood, gives this:
<h1>Not Found</h1><p>The requested URL /api-token-auth/ was not found on this server.</p>
I am very interested in your work, but when trying to run it with just the simple -
RobinhoodApi api = new RobinhoodApi("username", "password");
AccountElement accountData = api.getAccountData();
String accountNumber = accountData.getAccountNumber();
Float buyingPower = accountData.getBuyingPower();
System.out.println(accountNumber + " : " + String.valueOf(buyingPower));
I continually get the error on my log -
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes2.dex)
Any idea?
I noticed other errors that matched that one when I googled and they mentioned that the HTTP call may be deprecated after version 23. I tried recreating this app with 22 to see and it still didnt work with the same error (v27 and v22)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.