Why is the output empty here

Hello,

Doing my first steps waht could be a nice web site.
So far I have this :

(ns paintings.core
  (:require [clojure.data.json :as json]
            [clojure.walk :as w]))

(def slurp-memo (memoize slurp))

(defn read-all-data []
  (w/keywordize-keys
   (json/read-str
    (slurp-memo "https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True"))))


(defn filter-artObjects [data]
  (get data :artObjects))

(defn filter-all-objectNumbers [data]
  (map :objectNumber data))

(defn ask-for-image-data [objectNumbers]
  (for [number objectNumbers]
    (w/keywordize-keys
     (json/read-str
      (slurp (str "https://www.rijksmuseum.nl/api/nl/collection/" number "/tiles?key=14OGzuak&format=json"))))))

(defn filter-image-url [imagedata]
  (->> imagedata
       first
       :levels
       (filter  #(= "z6" (:name %)))))

(->> (read-all-data)
     (filter-artObjects)
     (filter-all-objectNumbers)
     (ask-for-image-data)
     (map filter-image-url))
 ```

but that  gives a empty collection 
What do I have done wrong ?

Debug by inspecting the intermediate results?

I converted this script to babashka so I could quickly try it out (the change being that for JSON cheshire is used):

(ns paintings.core
  (:require [cheshire.core :as json]))

(def slurp-memo (memoize slurp))

(defn read-all-data []
  (json/parse-string
   (slurp-memo "https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True")
   true))

(defn filter-artObjects [data]
  (get data :artObjects))

(defn filter-all-objectNumbers [data]
  (map :objectNumber data))

(defn ask-for-image-data [objectNumbers]
  (for [number objectNumbers]
    (json/parse-string
     (slurp (str "https://www.rijksmuseum.nl/api/nl/collection/" number "/tiles?key=14OGzuak&format=json"))
     true)))

(defn filter-image-url [imagedata]
  (->> imagedata
       :levels
       (filter  #(= "z6" (:name %)))
       first))

(->> (read-all-data)
     (filter-artObjects)
     (filter-all-objectNumbers)
     (ask-for-image-data)
     (keep filter-image-url))

This returns:

({:name "z6", :width 136, :height 56, :tiles [{:x 0, :y 0, :url "http://lh3.googleusercontent.com/gjsM0sJclVJ8rkta7ppoGI63RmNdSZAvbkXLKd7T1xFXE5WzPoQGyi3Y0zQXXcBeMr0Q4kSCjghstIvGr_3Pl6SYag=s0"}]})

Not sure if that is the result you were looking for, but I could figure this out quickly by looking at the intermediate values.

Thanks.

Almost what I expect but I excpect 10 resullt because there are 10 objectnumbers.

got it working now

(ns paintings.core
  (:require [cheshire.core :as json]))

(def slurp-memo (memoize slurp))

(defn read-all-data []
  (json/parse-string
   (slurp-memo "https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True")
   true))

(defn filter-artObjects [data]
  (get data :artObjects))

(defn filter-all-objectNumbers [data]
  (map :objectNumber data))

(defn ask-for-image-data [objectNumbers]
  (for [number objectNumbers]
    (json/parse-string
     (slurp (str "https://www.rijksmuseum.nl/api/nl/collection/" number "/tiles?key=14OGzuak&format=json"))
     true)))

(defn filter-image-url [imagedata]
  (->> imagedata
       :levels
       (sort-by :name)
       (last))
         )

(->> (read-all-data)
     (filter-artObjects)
     (filter-all-objectNumbers)
     (ask-for-image-data)
     (map filter-image-url))

But now I wonder if I can make a map where the height and width are placed