API Fetch Error

I’m trying to work through Chapter 20 and I’m stuck on page 359. The console prints:

{“stat”:“fail”,“code”:0,“message”:“Method “Flickr.interestingness.getList” not handled by library”}

I have a feeling the error is located in my FlickrAPI.swift file and its code is below:

import Foundation

enum Method: String {
    case interestingPhotos = "Flickr.interestingness.getList"

struct FlickrAPI {

static var interestingPhotosURL: URL {
    return flickrURL(method: .interestingPhotos, parameters: ["extras": "url_h,date_taken"])

private static let baseURLString = "https://api.flickr.com/services/rest"
private static let apiKey = "a6d819499131071f158fd740860a5a88"

private static func flickrURL(method: Method, parameters: [String:String]?) -> URL {

var components = URLComponents(string: baseURLString)!

var queryItems = [URLQueryItem]()

let baseParams = [
    "method": method.rawValue,
    "format": "json",
    "nojsoncallback": "1",
    "api_key": apiKey

for (key, value) in baseParams {
    let item = URLQueryItem(name: key, value: value)

if let additionalParams = parameters {
    for (key,value) in additionalParams {
        let item = URLQueryItem(name: key, value: value)


components.queryItems = queryItems

return components.url!


What have I done wrong in the code? Many thanks in advance.

In the Method enum, you capitalized the f in flickr. Set it to lowercase and it will work.

I did something similar. I initially had it spelled flicker, and it wasn’t working. When I changed it to flickr, it worked.

Then I changed it to Flickr and got the same error you are reporting above.