To get first value which match some criteria from list we can pass generator expression which iterates over this list with condition straight into next() which will return first value from passed generator. As you've mentioned in this comment, in case if there are two or more values which matches condition you need to get one which has "latest processed time" which I assume stored in "processed" key of each JSON object in list and contains date in ISO format. To achieve that we can sort list (using list.sort()) in descending order by value of "processed" key (passing itemgetter() as key argument) before lookup. And finally you've mentioned that you need to use extracted "key" in next URL, so you need just concatenate it between two URL path parts you provided.
Code:
import json
from urllib.request import urlopen
from operator import itemgetter
with urlopen('https://pv-ft-marketdata-store.ihsmvals-dev.com/email/search') as resp:
json_data = json.load(resp)
json_data.sort(key=itemgetter("processed"), reverse=True)
key = next(d["key"] for d in json_data if d["subject"] == "Indices Daily Level")
URL = "https://pv-ft-marketdata-store.ihsmvals-dev.com/email/" + key + "/data/html"
print(URL)
next(d["key"] for d in json_data if d["subject"] == "Indices Daily level")?print(next(d["key"] for d in json_data if d["subject"] == "Indices Daily Level"))json_data.sort(key=itemgetter("processed")). Don't forget to importitemgetter().