« Bash api » : différence entre les versions
| (6 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 7 : | Ligne 7 : | ||
==== Résumé ultra-condensé : Paris: 🌦 +17°C. ==== | ==== Résumé ultra-condensé : Paris: 🌦 +17°C. ==== | ||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl "wttr.in/ | curl "wttr.in/Paris?&format=3&lang=fr" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Données brutes (JSON) ==== | ==== Données brutes (JSON) ==== | ||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl "wttr.in/ | curl "wttr.in/Paris?&format=j1&lang=fr" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 22 : | Ligne 22 : | ||
==== Affiche les nuits (pour + de détails). ==== | ==== Affiche les nuits (pour + de détails). ==== | ||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl "wttr.in/ | curl "wttr.in/Paris?&n&lang=fr" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 43 : | Ligne 43 : | ||
<syntaxhighlight lang="bash" copy> | <syntaxhighlight lang="bash" copy> | ||
curl "wttr.in/48.8566,2.3522?format=v2" | curl "wttr.in/48.8566,2.3522?format=v2" | ||
</syntaxhighlight> | |||
==== open-meteo.com ==== | ==== open-meteo.com ==== | ||
<syntaxhighlight lang="bash" copy> | <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' | curl -s "https://api.open-meteo.com/v1/forecast?latitude=48.85&longitude=2.35¤t_weather=true" | jq '.current_weather' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === Localisation === | ||
Recherche | 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 | ||
| Ligne 62 : | Ligne 62 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== JokeAPI === | |||
Blagues | |||
<syntaxhighlight lang="bash" copy> | |||
curl "https://v2.jokeapi.dev/joke/Any?lang=fr" | |||
</syntaxhighlight> | |||
[[Catégorie:Tools]] [[category:api]] | |||
[[category:api]] | |||