« Api gouv » : différence entre les versions

Aucun résumé des modifications
 
(9 versions intermédiaires par le même utilisateur non affichées)
Ligne 35 : Ligne 35 :
=== adresse.data.gouv.fr ===
=== adresse.data.gouv.fr ===


{{#ifanon:
{{#ifanon:  
|
|  
==== Démo Requete 0 ====
==== Démo Requete 0 ====
<syntaxhighlight lang="bash" copy>
<syntaxhighlight lang="bash" copy>
curl -s "https://api-adresse.data.gouv.fr/search/?q=8+rue+du+chateau&city=conde+sur+suippe&postcode=02190&autocomplete=0" | jq '.features[0].geometry.coordinates'
curl -s "https://api-adresse.data.gouv.fr/search/?q=8+rue+du+chateau&city=conde+sur+suippe&postcode=02190&autocomplete=0" | jq '.features[0].geometry.coordinates'
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
[
[
Ligne 47 : Ligne 48 :
]
]
</syntaxhighlight>
</syntaxhighlight>
test google maps:   <br />
 
test google maps: <br />
[https://www.google.fr/maps/place/49.417098,3.951548 google.fr/maps/place/49.417098,3.951548]
[https://www.google.fr/maps/place/49.417098,3.951548 google.fr/maps/place/49.417098,3.951548]


----


----
<syntaxhighlight lang="bash" copy>
<syntaxhighlight lang="bash" copy>
curl -s "https://api-adresse.data.gouv.fr/reverse/?lon=3.951548&lat=49.417098" | jq '.features[0]'
curl -s "https://api-adresse.data.gouv.fr/reverse/?lon=3.951548&lat=49.417098" | jq '.features[0]'
</syntaxhighlight>
</syntaxhighlight>
}}
}}


==== Démo Requete 1 ====
==== Démo Requete 1 ====
Ligne 377 : Ligne 379 :
echo "Recherche terminée." >&2
echo "Recherche terminée." >&2
</syntaxhighlight>
</syntaxhighlight>


==== Exemple ====
==== Exemple ====
Ligne 425 : Ligne 428 :
./ecole.sh -c Reims -t lycee -o 10 -l 1 -f more
./ecole.sh -c Reims -t lycee -o 10 -l 1 -f more
</syntaxhighlight>
</syntaxhighlight>
<pre>
Résultat:  
Résultat:  
<syntaxhighlight>
Recherche des établissements à 'Reims'
Recherche des établissements à 'Reims'
Filtre : type 'lycee'
Filtre : type 'lycee'
Ligne 432 : Ligne 435 :
Décalage des résultats : 10
Décalage des résultats : 10
Nombre de résultats par page : 1
Nombre de résultats par page : 1
</syntaxhighlight>
</pre>
<syntaxhighlight lang="json" copy>
<syntaxhighlight lang="json" copy>


Ligne 451 : Ligne 454 :
]
]
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight>
<pre>
Nombre de résultats affichés: 1
Nombre de résultats affichés: 1
Prochain offset possible: 11
Prochain offset possible: 11
Recherche terminée.
Recherche terminée.
</syntaxhighlight>
</pre>
 




[[category:Divers]] [[category:api]]
[[category:Divers]] [[category:api]]