Is there a way to limit where a block displays based on a query in the URL?
You can implement a condition plugin that does just that and then configure your block to use that condition, we did something similar once:

/**
 * Condition on the page query param.
 *
 * @Condition(
 *   id = "yourproject__first_page",
 *   label = @Translation("First page (by url query param)")
 * )
 */
class FirstPage extends ConditionPluginBase {

  /**
   * {@inheritdoc}
   */
  public function evaluate() {
    $match = !\Drupal::request()-&gt;query-&gt;get('page');
    return $this-&gt;configuration['negate'] ? !$match : $match;
  }

  /**
   * {@inheritdoc}
   */
  public function summary() {
    return $this-&gt;t($this-&gt;configuration['negate'] ? 'The %param parameter is not %value' : 'The %param parameter is %value or empty', ['%param' =&gt; 'page', '%value' =&gt; 0]);
  }

}