Rikkihon / GroupProject

MIT License
0 stars 1 forks source link

Determine code to display recipe image through spoonacular API #27

Closed bvreeman closed 6 years ago

bvreeman commented 6 years ago

Recipes Recipe endpoints will almost always give you a recipe id. With that and the imageType you can build the complete image paths depending on your needs.

The base path for image URLs is https://spoonacular.com/recipeImages/. Once you know the recipe id {ID} and image type {TYPE}, you can complete that path to show an image. The complete path follows this pattern https://spoonacular.com/recipeImages/{ID}-{SIZE}.{TYPE}, where {SIZE} is one of the following:

90x90 240x150 312x150 312x231 480x360 556x370 636x393

A complete image path might look like this: https://spoonacular.com/recipeImages/579247-556x370.jpg