How are unofficial Apis made?

Asked

Viewed 142 times

2

I would like to create an Xbox API in PHP that returns user information as there is no official one. How can this be done? By using a Crawler? I saw that there is Casperjs, I used it and I was really able to get some information, but I didn’t want to use Nodejs as backend.

  • 1

    I’m reopening this question (along with 3 other users) by understanding it as a request for guidance, not a request for a full tutorial on how to create the API.

  • Exactly! It was not a request for how to do it, but rather how best to do it. There are several means but what is the most suitable?

1 answer

4


The vast majority of unofficial Apis work well anyway.

The first most important step is to read carefully the Term of Use, if any.

If there are no restrictions, you begin to outline the your service, verifying what Microsoft offers as a resource to players and thereby schematize their own and well-defined Uris.

An API has to be as descriptive as possible so that just by reading the URI you get a sense of what will be returned.

Once prepared you make your service work with that basic bê-a-bá of today (rteamento, MVC...).

Time to consider security. An API, even public, requires security even so you can control the data stream and prevent someone from having a more successful service at your expense.

The simplest of means is to tokens where the consumer programmer records the desire to use his API and his system returns an authorization key to which the programmer sends each request.

Then you start studying the source code of the resource pages, analyzing with some parser (X)(HT)ML or regularly (ER). With the so-called parser, depending on the language, it can be more laborious, but it’s the most ideal since if the original developer (Microsoft) changes a double quote to simple your API might not work anymore.

Depending on the case it is convenient to even cache the requests, by user ID perhaps to decrease both the number of requests made and the bandwidth consumed by the programmers who come to use their API.

Good studies :)

  • Thank you so much for the answer! Do you know if there is any Crawler/Spider in PHP or . NET? I found Casperjs (very good by the way) but did not want to use Nodejs as backend.

  • 1

    Well, that’s another five hundred. In addition to escaping (and much >.<) my knowledge, unlike a forum, characterizes a new doubt and, for this, a new topic.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.