Fabry-Perot cavity (FPC) based on Fiber Bragg gratings (FBGs) is an excellent candidate for fiber sensing and high-precision measurement. The advancement of the femtosecond laser micromachining technique provides more choices for the fabrication of FBGs-based FPCs. In this paper, we fabricate miniature FBGs-based FPCs, using the femtosecond laser line-by-line scanning writing technique for the first time. By this method, the FBGs can be limited to a specific area in the fiber core region. The grating length, position, and the distance between two successive FBGs can be conveniently controlled to achieve the desired transmission spectrum. For future applications in sensing, the temperature and strain responses of the fabricated FBGs-based FPCs were studied experimentally. This work provides a meaningful guidance for the fabrication and application of miniature FPCs based on FBGs.