Give me some questions to answer! Introduction

Sometimes I get bored and there are no new questions on PPCG, so I want you to dig a random question from PPCG's past.

Challenge

Given a user's PPCG ID as input (e.g. my ID is 30525), output the URL of a randomly chosen PPCG question. If the question does not meet the following criteria, you must choose another question until it does meet the criteria:


The question asker must not be the user whose ID was inputted to the question
The question must not have already been answered by the  user whose ID was inputted to the question
The question must not be unanswered: it's probably too hard
The question must not have over 10 answers: it's probably too easy
The question must be tagged code-golf


Rules

URL shorteners are disallowed.

You may use the Stack Exchange API and the Stack Exchange Data Explorer.

You will only ever be given a real PPCG user's ID.

In the unlikely event that there are no suitable questions, you do not have to output anything (undefined behaviour is fine).

Side Challenge

Although you won't be awarded extra points, it would be appreciated if someone designed a usable bookmarklet which, when run, opened the browser window to a random PPCG question that follows the above criteria. The user ID should be hardcoded into program (for the bookmarklet only).

Challenge

The shortest code in bytes wins.
JavaScript (ES6), 333 329 327 323 283 bytes

Needs to be run from within the api.stackexchange.com domain (relevant meta). Returns a Promise containing the URL (relevant meta).

f=async i=&gt;await(u="/questions/",s="?tagged=code-golf&amp;site=codegolf",q=await(await(await fetch(u+s)).json()).items.filter(x=&gt;x.owner.user_id!=i&amp;x.answer_count&lt;11).sort(_=&gt;.5-Math.random())[0],await(await fetch(u+q.question_id+s)).json()).items.some(x=&gt;x.owner.user_id==i)?f(i):q.link




Try it



f=async i=&gt;await(u="//api.stackexchange.com/questions/",s="?tagged=code-golf&amp;site=codegolf",q=await(await(await fetch(u+s)).json()).items.filter(x=&gt;x.owner.user_id!=i&amp;x.answer_count&lt;11).sort(_=&gt;.5-Math.random())[0],await(await fetch(u+q.question_id+s)).json()).items.some(x=&gt;x.owner.user_id==i)?f(i):q.link
k.previousSibling.value=58974 // me
k.onclick=_=&gt;f(+k.previousSibling.value).then(p=&gt;k.nextSibling.innerText=p)
&lt;input type=number&gt;&lt;button id=k&gt;Fetch&lt;/button&gt;&lt;pre&gt;






Bookmarklet

And here it is as a customisable bookmarklet, which will load a random question you've yet to answer. To use it, simply add a new bookmark to your browser's toolbar and drop the full code into the URL field.

Unlike the above solution, this works with all questions on a site therefore it may be slow to run (depending on the site and tags) and could also be expensive in the number of queries it needs to make to the API, as the API can only return 100 questions at a time.

To customise, change the following variables


k: Your API key - you can register for one here.
s: The Stack Exchange site you want to grab a question for.
i: Your user ID on that site.
t: The tags you want to filter by. There are 4 options available for this one:


"": An empty string; if you don't want to filter by any tags,
"code-golf;string": A semi-colon separated list of tags you want to filter by,
prompt("Tags:"): You will be prompted to enter the tags you want to filter by, or,
prompt("Tags:","code-golf;string"): You will be prompted to enter the tags you want to filter by, with a default list provided.



javascript:(f=(

/* See https://codegolf.stackexchange.com/a/122400/58974 for documenation */
k="",
s="codegolf",
i=58974,
t="code-golf",

p=1,q=[],r=1)=&gt;fetch((u="//api.stackexchange.com/questions/")+(d=`?key=${k}&amp;tagged=${t}&amp;site=`+s)+`&amp;page=${p}&amp;pagesize=100`).then(r=&gt;r.json()).then(j=&gt;r&amp;&amp;(q=[...q,...j.items.filter(x=&gt;x.owner.user_id!=i&amp;(a=x.answer_count)&amp;a&lt;11)])^j.has_more?f(i,k,s,t,p+1,q,1):q.sort(_=&gt;.5-Math.random())[0]).then(y=&gt;fetch(u+y.question_id+"/answers"+d).then(r=&gt;r.json()).then(j=&gt;j.items.some(x=&gt;x.owner.user_id==i)?f(i,k,s,t,q,0):window.location=y.link)))()