« Bash api » : différence entre les versions
Page créée avec « ==== openstreetmap ==== Recherche localisation <syntaxhighlight lang="bash" copy> curl "https://nominatim.openstreetmap.org/search?q=Eiffel+Tower&format=json" | jq </syntaxhighlight> ==== Devises ==== Exchange Rates <syntaxhighlight lang="bash" copy> curl "https://api.exchangerate-api.com/v4/latest/EUR" | jq '.rates.USD' </syntaxhighlight> ==== Météo ==== open-meteo.com <syntaxhighlight lang="bash" copy> curl -s "https://api.open-meteo.com/v1/forecast?latitud... » |
|||
| (14 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
==== | === Météo === | ||
Recherche | ==== Par défaut (3 jours). ==== | ||
<syntaxhighlight lang="bash" copy> | |||
curl wttr.in/paris | |||
</syntaxhighlight> | |||
==== Résumé ultra-condensé : Paris: 🌦 +17°C. ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/Paris?&format=3&lang=fr" | |||
</syntaxhighlight> | |||
==== Données brutes (JSON) ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/Paris?&format=j1&lang=fr" | |||
</syntaxhighlight> | |||
==== Météo actuelle ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/paris?0&lang=fr" | |||
</syntaxhighlight> | |||
==== Affiche les nuits (pour + de détails). ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/Paris?&n&lang=fr" | |||
</syntaxhighlight> | |||
==== Affiche en français ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/paris?lang=fr&v2" | |||
</syntaxhighlight> | |||
==== Affiche les phases de la Lune ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl wttr.in/Moon | |||
</syntaxhighlight> | |||
==== Affiche une adresse précise avec les coordonnées GPS ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/48.8566,2.3522" | |||
</syntaxhighlight> | |||
==== Affiche un graphique détaillé ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl "wttr.in/48.8566,2.3522?format=v2" | |||
</syntaxhighlight> | |||
==== open-meteo.com ==== | |||
<syntaxhighlight lang="bash" copy> | |||
curl -s "https://api.open-meteo.com/v1/forecast?latitude=48.85&longitude=2.35¤t_weather=true" | jq '.current_weather' | |||
</syntaxhighlight> | |||
=== Localisation === | |||
Recherche openstreetmap | |||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl "https://nominatim.openstreetmap.org/search?q=Eiffel+Tower&format=json" | jq | curl "https://nominatim.openstreetmap.org/search?q=Eiffel+Tower&format=json" | jq | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Devises === | |||
Exchange Rates | Exchange Rates | ||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
| Ligne 11 : | Ligne 62 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === JokeAPI === | ||
Blagues | |||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl | curl "https://v2.jokeapi.dev/joke/Any?lang=fr" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[category:api]] | |||
[[Catégorie:Tools]] [[category:api]] | |||