Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a large mixing bowl, whisk together the flour, sugar, baking powder, and salt.
In a separate bowl, lightly beat the eggs and then add the vanilla extract, almond extract (if using), and lemon zest (if using). Mix well.
Add the egg mixture to the dry ingredients and combine until you get a sticky dough.
Fold in the pistachios, ensuring they are evenly distributed throughout the dough.
Transfer the dough to a lightly floured surface and shape it into a log, about 12 inches long and 4 inches wide.
Place the log on the prepared baking sheet and bake for about 25-30 minutes or until it's lightly golden.
Remove the log from the oven and let it cool for about 10 minutes. Reduce the oven temperature to 325°F (160°C).
Once the log is cool enough to handle, cut it diagonally into 1/2-inch wide slices using a sharp knife.
Place the sliced biscotti back on the baking sheet, cut side down, and bake for an additional 10-15 minutes on each side until they become lightly toasted and crispy.
Let the biscotti cool completely on a wire rack before serving.