shell - Making a curl to an API and get an specific field from the JSON -
i'm making curl terminal following
curl -x "https://api.mercadolibre.com/items/mla511127356"
and response json, example one:
"id": "mla511127356", "site_id": "mla", "title": "item de testeo, por favor no ofertar --kc:off", "subtitle": null, "seller_id": "160252486", "category_id": "mla4967", "official_store_id": null, "price": 10, "base_price": 10, "original_price": null, "currency_id": "ars", "initial_quantity": 16,
is there simple way terminal?
thank in advantage.
by using jq parse json data instead of text based parsing.
curl -x "https://api.mercadolibre.com/items/mla511127356" | jq '.[].id'
Comments
Post a Comment