How to sanitize settings API value

Add a third parameter, which is an $args array, and add your sanitization callback in there:

register_setting( 
    'sports_api_key', 
    'sports_api_key', 
    array(
        'sanitization_callback' => 'sanitize_text_field'
    )
);

This is enough for your use case, the sanitize_text_field function already exists, so you don’t need to create it.

More information here for how to add a sanitization callback and here to sanitize text fields.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)