What resources help you to learn a new API?
In my day job, when I'm not learning things by reading and sharing here on DEV, I'm a developer advocate at Twitter. I've been doing this for quite a long time now, and I recognise that while I'm always learning for myself, I don't always stop to think about how other people learn.
I know that personally, I learn best from getting started guides, example code that makes sense, and the ability to "play with" an API using some kind of explorer or command line. I do not usually get so much from videos (but I love to take part in making them!).
How do YOU learn to use new APIs?
The more specific question / broader background...
In November, we launched Twitter API v2, which is a whole new way to access Twitter data, based on the OpenAPI specification, and with a more modern experience than v1.1 (which is around 11 years old - pretty rare for an API to last that long without major changes). We've hosted some Twitch streams and Twitter Spaces to talk about it.
We have documentation, a Postman Collection, and sample code.
twitterdev / Twitter-API-v2-sample-code
Sample code for the Twitter API v2 endpoints
Twitter API v2 sample code
Sample code for the Twitter API v2 endpoints Individual API features have folders where you can find examples of usage in several coding languages (Java, Node.js, Python, R, and Ruby).
Prerequisites
- Twitter API Essential Access (sign up here)
- A Project and an App created in the dashboard
Using the code samples
In order to run the samples in this repository you will need to set up some environment variables. You can find your credentials and bearer token in the App inside of your Project in the dashboard of the developer portal.
For OAuth 1.0a samples, you will need to export your consumer key and secret in your terminal. Be sure to replace <your_consumer_key>
and <your_consumer_secret>
with your own credentials without the < >
.
export CONSUMER_KEY='<your_consumer_key>'
export CONSUMER_SECRET='<your_consumer_secret>'
For samples which use bearer…
If you had the chance to request an educational resource about the Twitter API, what would you ask for? Tutorials, videos, Twitch, code? Any particular topic you want to know more about? Should we provide code in different languages - which ones, and why? Let me know in the discussion below, or follow me on Twitter and Tweet me a suggestion!