You asked

Is a 50mm f 1 8 a better portrait lens for my nikon aps c camera than the 20mm lens?

The 7Artisans 50mm f/1.8 won't mount on a Nikon body. The catalogue lists it only for Sony E, Fujifilm X and Micro Four Thirds, so it isn't an option for your camera.

For portraits, though, the 50mm is the better focal length than the 20mm. The portraits guide calls the 50mm f/1.8 the cheapest great portrait lens, and on APS-C it frames like a 75-80mm lens, which is flattering for faces. The 20mm is an ultra-wide. The guide notes that very wide lenses exaggerate whatever is nearest the camera, so noses and foreheads look larger. Its strengths are landscapes and night skies, where the Nikon Z 20mm f/1.8 S is described as a popular choice.

Your camera's sensor size also matters. The Nikon AF-S 20mm and Z 20mm are listed for full-frame cameras, and the 10-20mm DX zoom is listed for APS-C. If you're on APS-C, the 20mm full-frame lenses are not the right match for portraits anyway.

For a Nikon APS-C body, look for a 50mm prime with Nikon F mount, which this site doesn't cover in its catalogue. If you want a 50mm-class lens now, the first lenses guide suggests a 33-35mm f/1.4 to f/1.8 on APS-C for people and low light, and that is the closest kit-style starting point.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.