Answer the question
In order to leave comments, you need to log in
Why don't many sites use their own API?
Many sites now provide an API.
But I noticed that they do not always use it to display the site itself. Even so: almost no one.
Who uses some left access point, loading content via Ajax (the same VK, for example).
Who just generates html.
What is it connected with? Perhaps there is little code duplication inside, but outside, why do this?
Why not use the same access point for your own site?
Answer the question
In order to leave comments, you need to log in
Because the custom API appears later than the creation of the site in 70 percent of the cases.
About 20 more (out of 30 remaining) cannot design normally.
And you stumbled upon 10% (out of the remaining 10) - total total: 1%
That's the result.
I’m sure VK works through its api, Twitter, for example, here it generates ready-made HTML pages and does not work through its api, and for what reasons - it’s faster for them to render data to the client, in the form of a ready-made HTML page from the server, than to force a person to download some kind of JS libraries and then wait until they render responses from the api at the client. There, they deliberately decided to abandon additional layers. In addition, many API clients are built on single page application technology and do not allow content to be indexed, this is not a problem if you have some kind of data processing service, but if you have a content service, such as twitter, this may also be critical for you.
There is an internal api, there is an external one.
vk uses a common internal.
As a rule, to build one page, you need a lot of api methods - it’s better to make one request for yourself, which inside VK will make requests to internal api methods and return everything at once.
for example, a user goes to a group, you need to download a list of posts, a list of users in a group, contacts, admins, topics, etc. - these are many separate requests and for VK itself, groups need the same ones, why make 10 http requests?
for third-party applications, it is convenient to make methods minimal, so that they are suitable for everyone, not redundant, and understandable.
Plus, in the public api, there are still not all the possibilities of VK.
plus for the public api there are restrictions on requests for the application, most likely they are set at the web server level.
Plus, they can afford to have 2 APIs in terms of resources. and for VK it is not convenient to use your api, why not make a separate one. for smaller projects it is quite normal to use your own api.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question