Cut the broccoli and cook for 10 minutes until al dente, then drain. Chop 1 broccoli florets. Boil the spaghetti in salted water as usual and drain.
Sweat the onion in olive oil and add the chopped broccoli florets. Then stir in the broth, ricotta and pistachios. Season to taste with the spices. Finally fold in the capers and the remaining broccoli. Sprinkle with pistachios and serve.