Photos
AccuWeather's Current Conditions API features optional photos to illustrate weather conditions in the requested city. Photos are available in five different sizes, both portrait and landscape orientation. Get links to photos by passing "getPhotos=true" into a Current Conditions API query.
The number of photo links depends on how many suitable photos are stored in the database. No more than ten photos (five each in landscape and portrait) will return at a time. To prevent the same photo from showing up for all users, we recommend randomizing which of the photos from the list will be returned to the user.
The API returns links for photos in 1024 x 768 (large) size in both landscape and portrait orientation. Five different sizes in either orientation are available by editing the link.
Default links
All examples on this page show links that the API returns, and how changing those links will change the photo properties. For examples of these links in full responses, see the Current Conditions API guide page.
A link for a landscape photo in the large size will end in L_L.jpg
. For example:
cityscapes.accuweather.com/cityscapes/France/Paris_93467552_L_L.jpg
A link for a portrait photo in the large size will end in P_L.jpg
. For example:
cityscapes.accuweather.com/cityscapes/France/Paris_93467552_P_L.jpg
Available formats
4:3 aspect ratio
Code | Definition | Landscape | Portrait |
---|---|---|---|
S | Small | 240 x 180 | 180 x 240 |
M | Medium | 500 x 375 | 375 x 500 |
L | Large | 1024 x 768 | 768 x 1024 |
XL | Extra large | 1600 x 1199 | 1199 x 1600 |
XXL | Double-extra large | 2048 x 1535 | 1535 x 2048 |
16:9 aspect ratio
Code | Definition | Landscape | Portrait |
---|---|---|---|
S | Small | 240 x 135 | 135 x 240 |
M | Medium | 500 x 281 | 281 x 500 |
L | Large | 1024 x 576 | 576 x 1024 |
XL | Extra large | 1600 x 900 | 900 x 1600 |
XXL | Double-extra large | 2048 x 1152 | 1152 x 2048 |
Change the size
To create a link for a different size of the same photo, replace the default size code. Here is the first link again as an example:
/cityscapes/France/Paris_93467552_L_L.jpg
For the small version of the landscape photo, replace the last L
with S
:
/cityscapes/France/Paris_93467552_L_S.jpg
Use the same method to change the size of the portrait-oriented photo. Here is our original link:
/cityscapes/France/Paris_93467552_P_L.jpg
To change the size, replace size code L
with size code S
:
/cityscapes/France/Paris_93467552_P_S.jpg
Use any size code from the tables above in the same manner. For an extra-large version of the portrait photo, for example, replace size code L
with size code XL
.
Change the aspect ratio
All returned links are for 4:3 aspect ratio photos. Add HD
to the photo orientation to return a 16:9 photo. Here is the original link again as an example:
/cityscapes/France/Paris_93467552_L_L.jpg
To get a landscape, 16:9, large-sized photo, simply add HD
after the first L
:
/cityscapes/France/Paris_93467552_LHD_L.jpg
To get a portrait, 16:9, double-extra-large photo from the portrait orientation link, add HD
after P
and change L
to XXL
: