pgrimaud / horaires-ratp-api

Webservice pour les horaires et trafic RATP en temps réel
https://api-ratp.pierre-grimaud.fr/v4
MIT License
270 stars 30 forks source link

Typo "perburbations" on returned json #9

Closed tatic0 closed 8 years ago

tatic0 commented 9 years ago

Hello,

The request "http://api-ratp.pierre-grimaud.fr/data/trafic/rer" has a typo. It says "perburbations" instead of "perturbations".

Example: {"trafic":"perturbation","perburbations":[{"RER A":"06\/10\/15, 15:33, le trafic est ralenti sur la ligne (colis sus pect)"}]}

Kind Regards.

pgrimaud commented 9 years ago

Hello @tatic0

Thanks for the reporting. I just fixed it. I'm working on a better version for this API.

Take a look at it, if you want: http://api-ratp.pierre-grimaud.fr/v2/traffic/rers http://api-ratp.pierre-grimaud.fr/v2/traffic/metros

I'm gonna write a full documentation soon.

Regards

tatic0 commented 9 years ago

Hello @pgrimaud

Thanks for the lightning fast fix! I will check the v2 of the API, thanks for sharing.

If you need help for writing documentation and specially example scripts for non/bad developers, let me know, I have some spare time and lots of patience :)

Have a nice day,

sakkhho commented 8 years ago

Hello @pgrimaud thanks you for this api. to get an answer from the V2, it's take a long time. How is it possible ? I'm not a developper at all, but i would like to use this api. Can you please help me to decode the Json ?

pgrimaud commented 8 years ago

Hi @sakkhho, I hotfix the lag on v2, but can't definitely fix it until this evening. It must be very faster, tell me if it's ok.

sakkhho commented 8 years ago

Now it is perfect. What is the structure for the Json ? Hope your family and friends are safe, during this sad day...

pgrimaud commented 8 years ago

@sakkhho Sorry for the delay, I'm in Praha for the week. You can use the v2 with json or XML format. You just have to add the format type au the end of the uri.

http://api-ratp.pierre-grimaud.fr/v2/traffic?format=xml http://api-ratp.pierre-grimaud.fr/v2/traffic?format=json

Hope it could help you to use the data. If not, it will be a pleasure to help you, when I will come back to Paris mon day.

Yes, it was a sad day. The man who taught me SQL died last night in "Le bataclan"...

tatic0 commented 8 years ago

Damn, it's so sad. Dead is everywhere, even here. Glad you're OK.

sakkhho commented 8 years ago

Hello, Can you please give me the different status for "slug" and "title" from where you get the data ? How accurate are they ? is it real time data ? thanks you.

pgrimaud commented 8 years ago

Hi @sakkhho, I don't have a list of differents status, the slug and name are given from the RATP site. Some slugs are : normal, normal_trav or alerte.

So I'll make a resource with the differents slugs and name.

The data are parsed from the RATP's site. It may have 10/15 seconds latency due to a cache, but no more. So they're in real time.

You can compare with the screens on RATP's stations.

sakkhho commented 8 years ago

Thanks you. Another request :-), is the V2 of the api available for "horaires" also ? I cannot find the station 'POISSY' for example, is it because of SNCF part and not RATP part ?

pgrimaud commented 8 years ago

@sakkhho I found a new slug "critique".

http://api-ratp.pierre-grimaud.fr/v2/traffic/metros/9

{
    "response": {
        "metros": [
            {
                "line": "9",
                "slug": "critique",
                "title": "Trafic très perturbé",
                "message": "19/11/15, 15:28, le trafic est interrompu entre Trocadero et Pte de St-Cloud. Reprise estimée à 16:00. (colis suspect)"
            }
        ]
    },
    "_meta": {
        "version": "2",
        "date": "2015-11-19T15:48:44+01:00",
        "call": "GET /traffic/metros/9"
    }
}

For schedules, you can find some informations for RER A here: http://api-ratp.pierre-grimaud.fr/v2/rers/a

If you want schedules for Poissy with the destination Boissy/MLV, you can try : http://api-ratp.pierre-grimaud.fr/v2/rers/a/stations/poissy?destination=boissy+st+leger+marne+la+vallee

Unfortunately Poissy isn't a RATP part...

Exemple for a valid RATP part : http://api-ratp.pierre-grimaud.fr/v2/rers/a/stations/auber?destination=boissy+st+leger+marne+la+vallee

{
    "response": {
        "informations": {
            "destination": {
                "id": "2",
                "name": "Boissy-St-Léger Marne-la-Vallée",
                "slug": "boissy+st+leger+marne+la+vallee"
            },
            "line": "A",
            "type": "rer",
            "station": {
                "id": "2",
                "name": "Auber",
                "slug": "auber"
            }
        },
        "schedules": [
            {
                "id": "QHYR",
                "destination": "Marne la Vallee-Chessy",
                "message": "15:55"
            },
            {
                "id": "QIKY",
                "destination": "Marne la Vallee-Chessy",
                "message": "15:53"
            },
            {
                "id": "NELY",
                "destination": "Boissy Saint Leger",
                "message": "15:59"
            },
            {
                "id": "OKRE",
                "destination": "Torcy",
                "message": "16:01"
            },
            {
                "id": "NELY",
                "destination": "Boissy Saint Leger",
                "message": "16:04"
            },
            {
                "id": "QHYR",
                "destination": "Marne la Vallee-Chessy",
                "message": "16:06"
            }
        ]
    },
    "_meta": {
        "version": "2",
        "date": "2015-11-19T15:54:50+01:00",
        "call": "GET /rers/a/stations/auber?destination=boissy+st+leger+marne+la+vallee"
    }
}
sakkhho commented 8 years ago

it's a pity. from the transicilen API it is this opposite... not possible to get trains from Poissy to La Defense, because Poissy is RATP not SNCF ...

i got in return .... nothing. <?xml version="1.0" encoding="UTF-8"?

pgrimaud commented 8 years ago

@sakkhho Je me suis permis de clôre ce thread car je viens mettre en prod la version 2 avec une petite documentation.

Si besoin, n'hésite pas à ouvrir une nouvelle issue.