PDA

View Full Version : Project CARS & Project CARS 2 Static Data API



SenorPez
02-10-2017, 19:15
Project CARS Static Data API

Version:

Project CARS: v1
Project CARS 2: v0 (See notes.)


The Project CARS Static Data API is designed to provide static data through an interface that can be programmatically accessed by other Project CARS applications. Static data is data that is neither player nor console dependent, such as cars, tracks, and single-player events.

Access to the Project CARS Static Data API is available at http://www.projectcars.senorpez.com.

To retrieve Project CARS data, set the request Accept header to "application/vnd.senorpez.pcars.v1+json; charset=utf-8".
To retrieve Project CARS 2 data, set the request Accept header to "application/vnd.senorpez.pcars2.v0+json; charset=utf-8".
Fallback (web browser) access is available and will display Project CARS data. To view Project CARS 2 data, use a REST client such as Google Chrome's RESTLET plugin that can set the appropriate Accept header.


Documentation:

HTML5: http://www.projectcars.senorpez.com/docs/reference.html The documentation is rough but complete.


Notes:

The Project CARS 2 data is not yet complete. As I enter data the fields available will change. Application developers should monitor this thread or the github page of the project (https://github.com/SenorPez/literate-invention) for data structure changes. Once the structure is reasonably finished, the version of the Project CARS 2 access will change to 1 and be frozen. Future structure changes will be represented by a bump in the verison.
The Project CARS data is probably not complete but unlikely to change due to general disinterest.


Upcoming Features, Bug Reports, and Contributions:

The project will live here: https://github.com/SenorPez/literate-invention. You're welcome to file bug reports, suggestions for improvement, or fork the project to contribute your own changes.


You are welcome to use, test, break, and modify the Project CARS Static Data API to your heart's content. More people using it means more people breaking it means more improvements to the API.

If you have any questions, don't hesitate to reach out!

SenorPez
04-10-2017, 15:44
Project CARS 2 API Updated:

Changes:

All cars, with the exception of DLC cars, have been entered into the API. As a result, the data structure for car resources has been updated; see the documentation for an updated list of fields (http://www.projectcars.senorpez.com/docs/reference.html#resources-pcars2-car).
Abbreviations have been added to the car class resource. As a result, the data structure for class resources has been updated; see the documentation for an updated list of fields (http://www.projectcars.senorpez.com/docs/reference.html#resources-pcars2-class).


Upcoming Changes:

I'm trying to decide if the events structure will be the same as Project CARS. I kind of want to get Events > Rounds > Races finalized, but until I know more about how the single player game is structured, I hesitate to finalize those data structures. I want to get the data finalized, but I also don't want to be wrong!
Track data is going to have to wait until UDP packet specs come out. There's a strong chance it'll be identical to Project CARS, but I don't want to make that assumption until I can see raw data from the game.


Errors or Suggestions:

If you have the DLC cars available (I currently do not) or you find errors in my data entry, you can either input the data yourself (https://github.com/SenorPez/literate-invention/wiki/Editing-Static-Data-JSON-File) or send me a screenshot of the car select screen (preferably in metric units) and I'll make the updates.
Suggestions and bug reports are always welcome at https://github.com/SenorPez/literate-invention/issues


Thanks!

cry_inc
09-11-2017, 19:03
Thanks for this great project!

I was able to use your API to get the neccesary data to make vehicle class selection work again for my project over at pcars.13ms.de (http://pcars.13ms.de) :)

SenorPez
10-11-2017, 03:59
Thanks for this great project!

I was able to use your API to get the neccesary data to make vehicle class selection work again for my project over at pcars.13ms.de (http://pcars.13ms.de) :)

Glad to hear it's proving useful.

As I could have predicted, almost concurrently with the release (finally!) of the PCARS 2 UDP specs, my life got busy and I wasn't able to do what i wanted to do next. How this impacts the API? I'll be fleshing out the Track endpoint now that I'm able to get accurate track data from the game itself, as well as catching up on PCARS developments I may have missed over the past few weeks!