« Api gouv » : différence entre les versions

Aucun résumé des modifications
Ligne 145 : Ligne 145 :
</syntaxhighlight>
</syntaxhighlight>


==== Requete ====
==== Démo Requete ====
<syntaxhighlight lang="bash" line copy>
<syntaxhighlight lang="bash" line copy>
echo "Interrogation de l'API pour la ville '${ville}' (code postal: ${code})..."
curl -s "https://api-adresse.data.gouv.fr/search/?q=clermont+ferrand&type=municipality" | \
curl -s "https://api-adresse.data.gouv.fr/search/?q=${encoded_ville}&postcode=${code}&type=municipality" | \
jq '.features[] | {citycode: .properties.citycode, postcode: .properties.postcode, commune: .properties.city}'
jq '.features[] | {citycode: .properties.citycode, commune: .properties.city}'
</syntaxhighlight>
</syntaxhighlight>


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