Pat the chicken legs dry with paper towels. If sizes vary widely, group similar-sized pieces or slightly butterfly the largest.
In a bowl, whisk together soy sauce, brown sugar, mirin, grated pear, sesame oil, garlic, ginger, rice vinegar, and grated onion (if using) until sugar dissolves. Stir in sliced scallions, sesame seeds, black pepper and gochugaru/gochujang if using.
Place chicken in a large zip-top bag or nonreactive container. Pour the marinade over the chicken, seal, and refrigerate. Marinate at least 2 hours; ideally 8–12 hours or overnight. (If using pineapple, do not exceed 12–16 hours.)
About 20–30 minutes before cooking, remove chicken from fridge to take the chill off. Preheat the air fryer to 380°F (193°C) for 3–5 minutes.
Drain chicken and pat mostly dry — leave a light coating of marinade but remove excess moisture. Reserve the used marinade in a small saucepan for the finishing glaze.
Lightly oil the air fryer basket. Arrange chicken legs in a single layer, skin side down, with space between pieces. Do not overcrowd — cook in batches if necessary.
Air fry at 380°F (193°C) for 10–12 minutes. Flip chicken to skin side up and continue cooking 10–14 minutes. For extra caramelization, increase to 400°F (204°C) for the last 2–4 minutes — watch closely to prevent burning.
Check doneness with an instant-read thermometer: remove when thickest part reaches 165°F (74°C). For slightly more tender dark meat you may prefer 170°F–175°F.
Meanwhile, bring the reserved marinade to a vigorous boil in the saucepan and boil 3–5 minutes (this kills any raw chicken bacteria) then stir in honey (or extra brown sugar) and 1 tsp sesame oil; reduce to a glossy glaze.
Rest cooked chicken 5–8 minutes on a wire rack. Brush with the hot glaze, sprinkle with extra toasted sesame seeds and sliced scallions, and serve.