scrape through

Intermedio (B1) informal

To pass something like a test or hard situation, but only just — almost failing.

"He scraped through his chemistry exam with just two marks above the pass mark."