Search code examples
iosobjective-cuiimageviewuiimageyelp

Yelp API ios getting a larger image


I am currently using the Yelp API for my project, and I need to get the image of a business to use as a background, displayed in a UIImageView. However, all the pictures are too small from the pictures obtained, so the background is blurry. I use this code to obtain the current business images:

[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[businessDict objectForKey:@"image_url"]]]];

Is there anyway to obtain a larger image?


Solution

  • Replace the filename at the end of the image URL with o.jpg and you'll get up to 1000×1000 pixels. Other sizes are:

    • s.jpg: up to 40×40
    • ss.jpg: 40×40 square
    • m.jpg: up to 100×100
    • ms.jpg: 100×100 square
    • l.jpg: up to 600×400
    • ls.jpg: 250×250 square
    • o.jpg: up to 1000×1000
    • 348s.jpg: 348×348 square