How to parse a custom url (within WP site) and obtain params passed to that URL

First, you register your query vars param1 and param2:

function wpse_101951_query_vars( $qv ) {
    $qv[] = 'param1';
    $qv[] = 'param2';
    return $qv;
}
add_filter( 'query_vars', 'wpse_101951_query_vars' );

To use this information, you can pretty much hook into any action or filter after parse_query. That’s the first action available after the query vars are set, so it’s the first action where you can use get_query_var. Here’s an example:

function wpse_101951_get_params() {
    if ( $param1 = get_query_var( 'param1' ) ) {
        # Do something as a result of param1 being set
    }
    if ( $param2 = get_query_var( 'param2' ) ) {
        # Do something as a result of param2 being set
    }
}
add_action( 'parse_query', 'wpse_101951_get_params' );