When can you get current page ID and initialize hooks right after?

I’m developing a plugin and need to know on what page user is and then add specific hooks and filters for that page.
And my problem is that is_page() and the_ID() doesn’t work outside of wp, wp_loaded, init actions, but if i use these actions then i can’t initialize hooks because for them to work properly they must be added before those actions.
So my question being, is there any hook from witch i can call the_ID(), get a proper result and then add another hooks for that page? Or is it possible only using PHP’s $_SERVER['REQUEST_URI']?