Here are the highpoints from the article. If you try this I would suggest that you read all the details when planning and when you get there. https://www.traveloffpath.com/istanbul-airport-pcr-test-everything-you-need-to-know/
Does Turkey have any covid-19 travel restrictions?
No.
Getting a PCR test done at the IST airport is perfect for two types of travelers:
A traveler who is willing to make a 12-48 hour layover in Turkey before flying to their final destination that requires a test for entry
A traveler who is currently IN Turkey, or will be in Turkey before flying to a country that requires a test for entry
Do I need to clear customs to get to the test centre?
Yes.
You cannot directly access testing center from the transit/boarding area.
When is the test centre open?
open 24/7
Do I need an appointment?
No
How long does it take to get results?
average around 4-8 hours
How much does the test cost?
The test is 260 TL, or about $33 USD
How can I get a test on a lay-over?
First, you will need to make sure you have a visa to enter Turkey, since you will be going through customs to get to the testing area.
Then, make sure your layover is at the very MINIMUM 12 hours. Anything under 12 hours is risking your results not being ready in time.
Once you land, go through customs/passport control and then make your way to the arrivals hall near entrance 14.
Your test results should be ready before your next flight, providing it is at least 12 hours away
What if I am already in Turkey, have been vacationing in Turkey for a while, or will have a layover longer than 48 hours?
One day before your flight, make a separate trip to the airport to have your test performed.
The airport will allow you to enter if you bring your passport and proof of ticket, even if it is one or two days early.
Enter the airport through the departure hall, go through security and take the escalators down to the arrivals hall near Entrance 14 and have your test performed. You will get the results in good time before your flight the next day.
How Do I Get My Test Results?
The results will be available a few hours later at: https://enabiz.gov.tr/PcrTestSonuc/Index
In order to see your result, you will enter the barcode number from the sticker on your passport, as well as the last 4 digits of your passport for security.
Those results can then be used for entry for countries that allow digital proof. For any country that needs to have it printed out and/or sealed, you can go back to the facility and have them print it for you. You can request signatures or seals if you need them.
Results are printed in English