Getting entry only by slug


We are building a Next.js app with Contentful as our cms. Since we want a dynamic routing system, we are only using a catch-all-route in Next.js, that will determine what template to show depending on the returning data from Contentful (we are successfully using this structure together with other cms:es).

My question is: Is there a way to get a entry from Contentful only by providing the slug? That is, without a content_type?

And, how would one do to make sure there will be no duplication of slugs when creating/updating entries in Contentful?

Thank you!