Answer the question
In order to leave comments, you need to log in
How do you get an API?
Hello, the question may not seem clear, but I am new to this business and do not fully understand what the API in general means and how to get it.
My friend told in short how to get some requests with which you can interact with the server (or with the application), but they need to be found in data packets and if they are encrypted, then you need to disassemble the application and find the decryption key generator ... And then I did not understand anything at all.
Please tell us in simple words (analogies are welcome) what is going on with this API and what is it all about?
What are the requests and how can they be obtained if the program code has changed and the old requests (API, I just don’t know how to put the question correctly) have become unavailable?
If necessary, then the application in Java.
Answer the question
In order to leave comments, you need to log in
Wiki
API (application programming interface, application programming interface) (English application programming interface, API [hey-pee] [1]) - a description of the ways (a set of classes, procedures, functions, structures or constants) in which one computer program can interact with another program
I will give the simplest example with getting data. In fact, the API's possibilities are unlimited. Anything you want is possible. It's just that most often the API is used to get some kind of data.
The principle is this:
There is a site with the weather. To get the temperature in St. Petersburg, which they measured, you need to go to their website, type SPB in the search parameters and look with your eyes.
And so, to meet the need to "know the weather" - you just need to go to their site. But if you want your site/app/game to have the weather, then there will be problems
- In fact, you could just go to the weather site every 10 minutes, take data from there and upload it to your site. Agree - uncomfortable.
- Or you could set up a bot that would enter the site, simulating a user and get the temperature from the desired block, and then insert the results into your site. In fact, they do this when there is no API, but this is not a completely stable channel: a) you can be banned by ip for strange requests; b) if the layout of the site (the order of the blocks) changes, then of course you will no longer be able to get the temperature and you will have to rewrite the bot
And here API comes to the rescue. The principle is this: you can agree with the temperature supplier that you will take data from them. It can be either a paid service or a free one (usually it depends on the number of requests). As a result, you are given a link that already contains all the parameters that you need, and you simply set up your bot to get this data from the link and insert it on your site.
To see the temperature in St. Petersburg you need to open the link:
http://api.openweathermap.org/data/2.5/weather?q=Санкт-Петербург&units=metric
won't work, because the API key is not specified here. http://api.openweathermap.org/data/2.5/weather?q=Санкт-Петербург&units=metric&appid=0f47096f1eb155f8b277692876fb963e
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question